Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed bad links due to copy-paste from cwiki-test

...

Live Class Reloading

Main Article: Component Classes Class Reloading

Component classes are monitored for changes by the framework. Classes are reloaded when changed. This allows you to build your application with a speed approaching that of a scripting environment, without sacrificing any of the power of the Java platform.

...

Tapestry will instantiate your class using the default, no arguments constructor. Other constructors will be ignored.

Injection

Main Article: Component Classes Injection

Injection of dependencies occurs at the field level, via additional annotations. At runtime, fields that contain injections become read-only.

Code Block
languagejava
@Inject // inject a resource
private ComponentResources componentResources;

@Inject // inject a block
private Block foo;

@Inject // inject an asset
@Path("context:images/top_banner.png")
private Asset banner;

@Inject // inject a service
private AjaxResponseRenderer ajaxResponseRenderer;

Parameters

Main Article: Component ClassesParameters

Component parameters are private fields of your component class annotated with @Parameter. Component parameters represent a two-way binding of a field of your component and a property or resource of its containing component or page.

Persistent Fields

Main Article: Component Classes Persistent Page Data

Most fields in component classes are automatically cleared at the end of each request. However, fields may be annotated so that they retain their value across requests, using the @Persist annotation.

...