org.apache.tapestry5.annotations
Annotation Type ApplicationState


@Target(value=FIELD)
@Documented
@Retention(value=RUNTIME)
public @interface ApplicationState

Marker annotation for a field that is an application state object as controlled by the ApplicationStateManager. Application is something of a misnomer, as it implies that the object is stored as global, application-wide state (i.e., in the ServletContext). In fact, the built-in strategies for ASO management are very user specific, ultimately storing data in the Session.

An ASO file may have a companion field, of type boolean, used to see if the ASO has been created yet. If another field exists with the same name, suffixed with "Exists" (i.e., "aso" for the ASO field, and "asoExists" for the companion field) and the type of that field is boolean, then access to the field will determine whether the ASO has already been created. This is necessary because even a null check ("aso != null") may force the ASO to be created. Instead, check the companion boolean field ("asoExists").


Optional Element Summary
 boolean create
          If true (the default), then referencing an field marked with the annotation will create the ASO.
 

create

public abstract boolean create
If true (the default), then referencing an field marked with the annotation will create the ASO. If false, then accessing the field will not create the ASO, it will only allow access to it if it already exists.

Default:
true


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.