|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.lifecycle.ClientWindow
public abstract class ClientWindow
This class represents a client window,
which may be a browser tab, browser window, browser pop-up, portlet,
or anything else that can display a UIComponent
hierarchy rooted at a UIViewRoot
.
Modes of Operation
none mode
The generation of ClientWindow
is controlled by the
value of the context-param
named by the value of WINDOW_ID_MODE_PARAM_NAME
. If this context-param
is
not specified, or its value is "none", no ClientWindow
instances will be generated, and the entire feature is effectively
disabled for the entire application.
Other modes
For all other valid values of WINDOW_ID_MODE_PARAM_NAME
, including custom values not explicitly covered
in this specification, the lifetime of a
ClientWindow
starts on the first request made by a
particular client window (or tab, or pop-up, etc) to the JSF runtime
and persists as long as that window remains open or the session expires,
whichever comes first. A client window is
always associated with exactly one UIViewRoot
instance
at a time, but may display many different UIViewRoot
s
during its lifetime.
The ClientWindow
instance is associated with the
incoming request during the Lifecycle.attachWindow(javax.faces.context.FacesContext)
method.
This method will cause a new instance of ClientWindow
to
be created, assigned an id, and passed to ExternalContext.setClientWindow(javax.faces.lifecycle.ClientWindow)
.
During state saving, regardless of the window id mode, or state
saving mode, a hidden field must be written whose name, id and value
are given as specified in ResponseStateManager.WINDOW_ID_PARAM
.
url mode
If the value of the WINDOW_ID_MODE_PARAM_NAME
is "url",
without the quotes, the encoding of the ClientWindow
must be performed as follows, in addition to the hidden field already
described. The runtime must ensure that any component that renders a
hyperlink that causes the user agent to send a GET request to the
Faces server when it is clicked has a query parameter with a name and
value specified in ResponseStateManager.WINDOW_ID_URL_PARAM
.
This requirement is met by several of the "encode" methods on ExternalContext
See ExternalContext.encodeActionURL(java.lang.String)
for details, including a special case where the windowId is not
appended even though url mode is enabled.
Field Summary | |
---|---|
static String |
WINDOW_ID_MODE_PARAM_NAME
The context-param that controls the operation
of the |
Constructor Summary | |
---|---|
ClientWindow()
|
Method Summary | |
---|---|
abstract void |
decode(FacesContext context)
The implementation is responsible
for examining the incoming request and extracting the value that must
be returned from the |
static void |
disableClientWindowUrlMode(FacesContext context)
Components that permit per-use disabling of the appending of the windowId in generated URLs must call this method first before rendering those URLs. |
static void |
enableClientWindowUrlMode(FacesContext context)
Components that permit per-use disabling of the appending of the windowId in generated URLs must call this method first after rendering those URLs. |
abstract String |
getId()
Return a String value that uniquely
identifies this |
static boolean |
isClientWindowUrlModeEnabled(FacesContext context)
Methods that append the windowId to generated URLs must call this method to see if they are permitted to do so. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String WINDOW_ID_MODE_PARAM_NAME
The context-param that controls the operation
of the ClientWindow
feature. Valid values are "none" and
"url", without the quotes. If not specified, "none" is assumed.
Constructor Detail |
---|
public ClientWindow()
Method Detail |
---|
public abstract String getId()
Return a String value that uniquely
identifies this ClientWindow
within the scope of the current session. See decode(javax.faces.context.FacesContext)
for the
specification of how to derive this value.
public abstract void decode(FacesContext context)
The implementation is responsible
for examining the incoming request and extracting the value that must
be returned from the getId()
method. If WINDOW_ID_MODE_PARAM_NAME
is "none" this method must not be invoked. If WINDOW_ID_MODE_PARAM_NAME
is "url" the implementation must first look for a request parameter
under the name given by the value of ResponseStateManager.WINDOW_ID_PARAM
.
If no value is found, look for a request parameter under the name given
by the value of ResponseStateManager.WINDOW_ID_URL_PARAM
.
If no value is found, fabricate an id that uniquely identifies this
ClientWindow
within the scope of the current session. This
value must be encrypted with a key stored in the http session and made
available to return from the getId()
method. The value must be
suitable for inclusion as a hidden field or query parameter.
If a value is found, decrypt it using the key from the session and
make it available for return from getId()
.
context
- the FacesContext
for this request.public static void disableClientWindowUrlMode(FacesContext context)
Components that permit per-use disabling
of the appending of the windowId in generated URLs must call this method
first before rendering those URLs. The caller must call enableClientWindowUrlMode(javax.faces.context.FacesContext)
from a finally
block after rendering the URL. If
WINDOW_ID_MODE_PARAM_NAME
is "url" without the quotes, all generated
URLs that cause a GET request must append the windowId by default.
context
- the FacesContext
for this request.public static void enableClientWindowUrlMode(FacesContext context)
Components that permit per-use disabling
of the appending of the windowId in generated URLs must call this method
first after rendering those URLs. If
WINDOW_ID_MODE_PARAM_NAME
is "url" without the quotes, all generated
URLs that cause a GET request must append the windowId by default.
context
- the FacesContext
for this request.public static boolean isClientWindowUrlModeEnabled(FacesContext context)
Methods that append the windowId to generated
URLs must call this method to see if they are permitted to do so. If
WINDOW_ID_MODE_PARAM_NAME
is "url" without the quotes, all generated
URLs that cause a GET request must append the windowId by default.
context
- the FacesContext
for this request.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |