Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In a Tapestry application, most application classes , including your services, are loaded from the middle class loader. Additional class loaders are used
to support live service reloading, and live component reloading (along with component class transformation).

When a page or component is passed as a parameter to a service, a failure occurs
(how it is reported varies in different JDK releases) because of the class mismatch.

The solution is to define an interface with the methods that the service will invoke on the page or component instance. The service will expect an object implementing the interface (and doesn't care what class loader loaded
the implementing class).

Just be sure to put the interface class in a non-controlled package, such as your application's root-package (and not root-package.pages).

Which is better, using magic method names (i.e., beginRender()) or annotations (i.e. BeginRender)?

...