There are two types of server side state that are supported by Tapestry: persistent page properties and the visit object. The first (page properties) have already been discussed.
The visit object is a central repository for application state and presentation logic. The visit object
is accessible through the application engine (the engine implements a visit
property).
The application engine doesn't care about the class of the visit object, or what properties it
implements.
The visit object holds central information that is needed by many pages. For example, an e- commerce application may store the shopping cart as a property of the visit object.
When using Enterprise JavaBeans, the visit object is a good place to store remote object references (centralizing the logic to look up home interfaces, instantiate references, etc.).
Every page implements a visit
property that allows access to the visit object.
When using the SimpleEngine
engine,
the visit object is
created the first time it is referenced. The class of the visit object is stored in the application
specification.