Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: spelling fixes

...

Making a field persistent is accomplished with the Persist annotation. Again, this does not refer to database persistence, it refers to session persistancepersistence.

This annotation is applied to private instance fields of components.

...

The value for each field is the strategy used to store the field between requests.

...

Session Strategy

The session strategy stores field changes into the session; the session is created as necessary.

...

Session strategy is the default strategy used unless otherwise overridden.

...

Flash Strategy

The flash strategy stores information in the session as well, just for not very long. Values are stored into the session, but then deleted from the session as they are first used to restore a page's state.

The flash is typically used to store temporary messages that should only be displayed to the user once.

...

Client Strategy

The field is persisted onto the client; you will see an additional query parameter in each URL (or an extra hidden field in each form).

...

Use client persistence with care, and store a minimal amount of data. Try to store the identity (that is, primary key) of an object, rather than the object itself.

Persistence

...

Strategy Inheritance

By default the value for the Persist annotation is the empty string. When this is true, then the actual strategy to be used is determined by a search up the component hiearchyhierarchy.

For each component, the meta-data property tapestry.persistence-strategy is checked. This can be specified using the Meta annotation.

...