Versions Compared

Key

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

...

Unless an instance variable is decorated with an annotation, it will be a transient instance variable. This means that its value resets to its default value at the end of reach request (when the page is detached from the request).

Note
titleAbout initialization

Never initialize an instance field to a mutable object at the point of declaration. If this is done, the instance created from that initializer becomes the default value for that field and is reused inside the component on every request. This could cause state to inadvertently be shared between different sessions in an application.

Deprecated
since5.2

For Tapestry 5.1 and earlier, if you have a variable that can keep its value between requests and you would like to defeat that reset logic, then you can add a @Retain annotation to the field. You should take care that no client-specific data is stored into such a field, since on a later request the same page instance may be used for a different user. Likewise, on a later request for the same user, a different page instance may be used.

...