⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 responsestatemanager.html

📁 j2ee帮助文档软件设计/软件工程 文件格式
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.render.ResponseStateManager.RENDER_KIT_ID_PARAM">Constant Field Values</A></DL></DL><HR><A NAME="VIEW_STATE_PARAM"><!-- --></A><H3>VIEW_STATE_PARAM</H3><PRE>public static final <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>VIEW_STATE_PARAM</B></PRE><DL><DD><p>Implementations must use this value as the name and id of the client parameter in which to save the state between requests.</p><P><DL><DT><B>Since:</B></DT>  <DD>1.2</DD><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.render.ResponseStateManager.VIEW_STATE_PARAM">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="ResponseStateManager()"><!-- --></A><H3>ResponseStateManager</H3><PRE>public <B>ResponseStateManager</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="writeState(javax.faces.context.FacesContext, java.lang.Object)"><!-- --></A><H3>writeState</H3><PRE>public void <B>writeState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                       <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;state)                throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)"><!-- --></A><H3>writeState</H3><PRE>public void <B>writeState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                       <A HREF="../../../javax/faces/application/StateManager.SerializedView.html" title="class in javax.faces.application">StateManager.SerializedView</A>&nbsp;state)                throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method has been replaced by <A HREF="../../../javax/faces/render/ResponseStateManager.html#writeState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>writeState(javax.faces.context.FacesContext,java.lang.Object)</CODE></A>. The default implementation of this method does nothing.</I><P><DD><p>Take the argument <code>state</code> and write it into the output using the current <A HREF="../../../javax/faces/context/ResponseWriter.html" title="class in javax.faces.context"><CODE>ResponseWriter</CODE></A>, which must be correctly positioned already.</p> <p>If the <A HREF="../../../javax/faces/application/StateManager.SerializedView.html" title="class in javax.faces.application"><CODE>StateManager.SerializedView</CODE></A> 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.</p> <p>If the state saving method for this application is <A HREF="../../../javax/faces/application/StateManager.html#STATE_SAVING_METHOD_CLIENT"><CODE>StateManager.STATE_SAVING_METHOD_CLIENT</CODE></A>, 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.  </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> instance for the current request<DD><CODE>state</CODE> - The serialized state information previously saved<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="getState(javax.faces.context.FacesContext, java.lang.String)"><!-- --></A><H3>getState</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                       <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;viewId)</PRE><DL><DD><p>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 <A HREF="../../../javax/faces/render/ResponseStateManager.html#writeState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>writeState(javax.faces.context.FacesContext,java.lang.Object)</CODE></A>.</p> <p>For backwards compatability with existing <code>ResponseStateManager</code> implementations, the default implementation of this method calls <A HREF="../../../javax/faces/render/ResponseStateManager.html#getTreeStructureToRestore(javax.faces.context.FacesContext, java.lang.String)"><CODE>getTreeStructureToRestore(javax.faces.context.FacesContext, java.lang.String)</CODE></A> and <A HREF="../../../javax/faces/render/ResponseStateManager.html#getComponentStateToRestore(javax.faces.context.FacesContext)"><CODE>getComponentStateToRestore(javax.faces.context.FacesContext)</CODE></A> and creates and returns a two element <code>Object</code> array with element zero containing the <code>structure</code> property and element one containing the <code>state</code> property of the <code>SerializedView</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> instance for the current request<DD><CODE>viewId</CODE> - View identifier of the view to be restored<DT><B>Returns:</B><DD>the tree structure and component state Object passed in to <code>writeState</code>.  If this is an initial request, this method returns <code>null</code>.<DT><B>Since:</B></DT>  <DD>1.2</DD></DL></DD></DL><HR><A NAME="getTreeStructureToRestore(javax.faces.context.FacesContext, java.lang.String)"><!-- --></A><H3>getTreeStructureToRestore</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getTreeStructureToRestore</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                                        <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;viewId)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method has been replaced by <A HREF="../../../javax/faces/render/ResponseStateManager.html#getState(javax.faces.context.FacesContext, java.lang.String)"><CODE>getState(javax.faces.context.FacesContext, java.lang.String)</CODE></A>. The default implementation returns <code>null</code>.</I><P><DD><p>The implementation must inspect the current request and return the tree structure Object passed to it on a previous invocation of <code>writeState()</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> instance for the current request<DD><CODE>viewId</CODE> - View identifier of the view to be restored</DL></DD></DL><HR><A NAME="getComponentStateToRestore(javax.faces.context.FacesContext)"><!-- --></A><H3>getComponentStateToRestore</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getComponentStateToRestore</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method has been replaced by <A HREF="../../../javax/faces/render/ResponseStateManager.html#getState(javax.faces.context.FacesContext, java.lang.String)"><CODE>getState(javax.faces.context.FacesContext, java.lang.String)</CODE></A>. The default implementation returns <code>null</code>.</I><P><DD><p>The implementation must inspect the current request and return the component state Object passed to it on a previous invocation of <code>writeState()</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> instance for the current request</DL></DD></DL><HR><A NAME="isPostback(javax.faces.context.FacesContext)"><!-- --></A><H3>isPostback</H3><PRE>public boolean <B>isPostback</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)</PRE><DL><DD><p>Return true if the current request is a postback.  This method is leveraged from the <i>Restore View Phase</i> to determine if <A HREF="../../../javax/faces/application/ViewHandler.html#restoreView(javax.faces.context.FacesContext, java.lang.String)"><CODE>ViewHandler.restoreView(javax.faces.context.FacesContext, java.lang.String)</CODE></A> or <A HREF="../../../javax/faces/application/ViewHandler.html#createView(javax.faces.context.FacesContext, java.lang.String)"><CODE>ViewHandler.createView(javax.faces.context.FacesContext, java.lang.String)</CODE></A> should be called. The default implementation must return <code>true</code> if this <code>ResponseStateManager</code> instance wrote out state on a previous request to which this request is a postback, <code>false</code> otherwise.</p> <p>The implementation if this method for the Standard HTML RenderKit must consult the <A HREF="../../../javax/faces/context/ExternalContext.html" title="class in javax.faces.context"><CODE>ExternalContext</CODE></A>'s <code>requestParameterMap</code> and return <code>true</code> if and only if there is a key equal to the value of the symbolic constant <A HREF="../../../javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM"><CODE>VIEW_STATE_PARAM</CODE></A>.</p> <p>For backwards compatability with implementations of <code>ResponseStateManager</code> prior to JSF 1.2, a default implementation is provided that consults the <A HREF="../../../javax/faces/context/ExternalContext.html" title="class in javax.faces.context"><CODE>ExternalContext</CODE></A>'s <code>requestParameterMap</code> and return <code>true</code> if its size is greater than 0.</p><P><DD><DL><DT><B>Since:</B></DT>  <DD>1.2</DD></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../javax/faces/render/RenderKitFactory.html" title="class in javax.faces.render"><B>PREV CLASS</B></A>&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javax/faces/render/ResponseStateManager.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ResponseStateManager.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -