|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个 CLASS | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
javax.faces.render Class ResponseStateManager
java.lang.Object javax.faces.render.ResponseStateManager
public abstract class ResponseStateManager
- extends Object
ResponseStateManager is the helper class to
StateManager
that knows the specific
rendering technology being used to generate the response. It is a
singleton abstract class, vended by the RenderKit
. This
class knows the mechanics of saving state, whether it be in hidden
fields, session, or some combination of the two.
字段摘要 | |
---|---|
static String |
RENDER_KIT_ID_PARAM
The name of the request parameter used by the default implementation of ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext) to
derive a RenderKit ID. |
static String |
VIEW_STATE_PARAM
Implementations must use this value as the name and id of the client parameter in which to save the state between requests. |
构造器摘要 | |
---|---|
ResponseStateManager()
|
方法摘要 | |
---|---|
Object |
getComponentStateToRestore(FacesContext context)
Deprecated. This method has been replaced by getState(javax.faces.context.FacesContext, java.lang.String) .
The default implementation returns null . |
Object |
getState(FacesContext context,
String viewId)
The implementation must inspect the current request and return an Object representing the tree structure and component state passed in to a previous invocation of writeState(javax.faces.context.FacesContext,java.lang.Object) . |
Object |
getTreeStructureToRestore(FacesContext context,
String viewId)
Deprecated. This method has been replaced by getState(javax.faces.context.FacesContext, java.lang.String) .
The default implementation returns null . |
boolean |
isPostback(FacesContext context)
Return true if the current request is a postback. |
void |
writeState(FacesContext context,
Object state)
|
void |
writeState(FacesContext context,
StateManager.SerializedView state)
Deprecated. This method has been replaced by writeState(javax.faces.context.FacesContext,java.lang.Object) .
The default implementation of this method does nothing. |
类方法继承 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
RENDER_KIT_ID_PARAM
public static final String RENDER_KIT_ID_PARAM
The name of the request parameter used by the default implementation of
ViewHandler.calculateRenderKitId(javax.faces.context.FacesContext)
to derive a RenderKit ID.- 另请参见:
- 常量字段
VIEW_STATE_PARAM
public static final String VIEW_STATE_PARAM
Implementations must use this value as the name and id of the client parameter in which to save the state between requests.
- 从以下版本开始:
- 1.2
- 另请参见:
- 常量字段
构造器详细信息 |
---|
ResponseStateManager
public ResponseStateManager()
方法详细信息 |
---|
writeState
public void writeState(FacesContext context, Object state) throws IOException
- 抛出异常:
IOException
writeState
public void writeState(FacesContext context, StateManager.SerializedView state) throws IOException
- Deprecated. This method has been replaced by
writeState(javax.faces.context.FacesContext,java.lang.Object)
. The default implementation of this method does nothing. Take the argument
state
and write it into the output using the currentResponseWriter
, which must be correctly positioned already.If the
StateManager.SerializedView
is to be written out to hidden fields, the implementation must take care to make all necessary character replacements to make the Strings suitable for inclusion as an HTTP request paramater.If the state saving method for this application is
StateManager.STATE_SAVING_METHOD_CLIENT
, the implementation may encrypt the state to be saved to the client. We recommend that the state be unreadable by the client, and also be tamper evident. The reference implementation follows these recommendations.- 参数:
context
- TheFacesContext
instance for the current requeststate
- The serialized state information previously saved- 抛出异常:
IOException
getState
public Object getState(FacesContext context, String viewId)
The implementation must inspect the current request and return an Object representing the tree structure and component state passed in to a previous invocation of
writeState(javax.faces.context.FacesContext,java.lang.Object)
.For backwards compatability with existing
ResponseStateManager
implementations, the default implementation of this method callsgetTreeStructureToRestore(javax.faces.context.FacesContext, java.lang.String)
andgetComponentStateToRestore(javax.faces.context.FacesContext)
and creates and returns a two elementObject
array with element zero containing thestructure
property and element one containing thestate
property of theSerializedView
.- 参数:
context
- TheFacesContext
instance for the current requestviewId
- View identifier of the view to be restored- 返回:
- the tree structure and component state Object passed in
to
writeState
. If this is an initial request, this method returnsnull
. - 从以下版本开始:
- 1.2
getTreeStructureToRestore
public Object getTreeStructureToRestore(FacesContext context, String viewId)
- Deprecated. This method has been replaced by
getState(javax.faces.context.FacesContext, java.lang.String)
. The default implementation returnsnull
. The implementation must inspect the current request and return the tree structure Object passed to it on a previous invocation of
writeState()
.- 参数:
context
- TheFacesContext
instance for the current requestviewId
- View identifier of the view to be restored
getComponentStateToRestore
public Object getComponentStateToRestore(FacesContext context)
- Deprecated. This method has been replaced by
getState(javax.faces.context.FacesContext, java.lang.String)
. The default implementation returnsnull
. The implementation must inspect the current request and return the component state Object passed to it on a previous invocation of
writeState()
.- 参数:
context
- TheFacesContext
instance for the current request
isPostback
public boolean isPostback(FacesContext context)
Return true if the current request is a postback. This method is leveraged from the Restore View Phase to determine if
ViewHandler.restoreView(javax.faces.context.FacesContext, java.lang.String)
orViewHandler.createView(javax.faces.context.FacesContext, java.lang.String)
should be called. The default implementation must returntrue
if thisResponseStateManager
instance wrote out state on a previous request to which this request is a postback,false
otherwise.The implementation if this method for the Standard HTML RenderKit must consult the
ExternalContext
'srequestParameterMap
and returntrue
if and only if there is a key equal to the value of the symbolic constantVIEW_STATE_PARAM
.For backwards compatability with implementations of
ResponseStateManager
prior to JSF 1.2, a default implementation is provided that consults theExternalContext
'srequestParameterMap
and returntrue
if its size is greater than 0.- 从以下版本开始:
- 1.2
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个 CLASS | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.