Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Simplifed lead paragraphs, fixed broken links

Live Class and Template Reloading

One of the great new features of Tapestry 5 is automatic reloading of changed classes and templates.

In previous versions of Tapestry, reloading of templates was supported in development mode only. Reloading of classes required a restart of the servlet container (or a redeploy of the web application).

In Tapestry 5, page Page and component classes will automatically reload when changed. Likewise, changes to component templates and other related resources will also be picked up immediately. In addition, starting in version 5.2, your service classes will also be reloaded automatically after changes (if you're using Tapestry IoC).

Template Reloading

When a template changes, all page instances (as well as the hiearchy hierarchy of components below them) are discarded and reconstructed with the new template. However, classes are not reloaded in this case.

...

On a change to any loaded class from inside a controlled package (or any sub-package of a controlled package), Tapestry will discard all page instances, and discard the class loader.

Persistent field data on the pages will usually not be affected (as it is stored separately, in the session). This allows you to make fairly significant changes to a component class even while the application continues to run.

...

Reloading is based on package name; the packages that are reloaded are derived from the application configuration.

If your root package is code_org.example.myapp/code_, then only classes in the following packages will be scanned for automatic reloads:

...