@Target(value=FIELD) @Documented @Retention(value=RUNTIME) @UseWith(value={COMPONENT,MIXIN,PAGE}) public @interface SessionState
ApplicationStateManager
. An SSO property is stored as
global session object (i.e., in the ServletContext
), accessible to every
page or component, but in fact the built-in strategies for SSO management are
session-specific, ultimately storing data in the Session
.
For each SSO property, you may declare a companion boolean property that can be checked to see if the SSO has been created yet. The companion boolean property must have the same name as the SSO property but suffixed with "Exists" (e.g., an SSO property named "user" and a companion boolean property named "userExists"). You can access the boolean property to determine whether the SSO has already been created. This mechanism is necessary because even a null check ("user != null") may force the SSO to be created. Instead, check the companion boolean field ("userExists").
Note: Tapestry 5.0 called these objects "Application State Objects"; thus some of the underlying services have confusing names (e.g., ApplicationStateManager, which really should be SessionStateManager) but can't be renamed for backward compatibility reasons.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
create
If true (the default), then referencing an field marked with the annotation will create the SSO.
|
public abstract boolean create
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.