viewhandler.html

来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 672 行 · 第 1/3 页

HTML
672 行
字号
<DD><p>Create and return a new <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component"><CODE>UIViewRoot</CODE></A> instance initialized with information from the argument <code>FacesContext</code> and <code>viewId</code>.</p> <p>If there is an existing <code>ViewRoot</code> available on the <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A>, this method must copy its <code>locale</code> and <code>renderKitId</code> to this new view root.  If not, this method must call <A HREF="../../../javax/faces/application/ViewHandler.html#calculateLocale(javax.faces.context.FacesContext)"><CODE>calculateLocale(javax.faces.context.FacesContext)</CODE></A> and <A HREF="../../../javax/faces/application/ViewHandler.html#calculateRenderKitId(javax.faces.context.FacesContext)"><CODE>calculateRenderKitId(javax.faces.context.FacesContext)</CODE></A>, and store the results as the values of the  <code>locale</code> and <code>renderKitId</code>, proeprties, respectively, of the newly created <code>UIViewRoot</code>.</p><P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code>  is <code>null</code></DL></DD></DL><HR><A NAME="getActionURL(javax.faces.context.FacesContext, java.lang.String)"><!-- --></A><H3>getActionURL</H3><PRE>public abstract <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>getActionURL</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>Return a URL suitable for rendering (after optional encoding performed by the <code>encodeActionURL()</code> method of <A HREF="../../../javax/faces/context/ExternalContext.html" title="class in javax.faces.context"><CODE>ExternalContext</CODE></A>) that selects the specified view identifier.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for this request<DD><CODE>viewId</CODE> - View identifier of the desired view<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>viewId</code> is not  valid for this <code>ViewHandler</code>.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code> or  <code>viewId</code> is <code>null</code>.</DL></DD></DL><HR><A NAME="getResourceURL(javax.faces.context.FacesContext, java.lang.String)"><!-- --></A><H3>getResourceURL</H3><PRE>public abstract <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>getResourceURL</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;path)</PRE><DL><DD><p>Return a URL suitable for rendering (after optional encoding perfomed by the <code>encodeResourceURL()</code> method of <A HREF="../../../javax/faces/context/ExternalContext.html" title="class in javax.faces.context"><CODE>ExternalContext</CODE></A>) that selects the specifed web application resource.  If the specified path starts with a slash, it must be treated as context relative; otherwise, it must be treated as relative to the action URL of the current view.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DD><CODE>path</CODE> - Resource path to convert to a URL<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>viewId</code> is not  valid for this <code>ViewHandler</code>.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code> or  <code>path</code> is <code>null</code>.</DL></DD></DL><HR><A NAME="initView(javax.faces.context.FacesContext)"><!-- --></A><H3>initView</H3><PRE>public void <B>initView</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)              throws <A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></PRE><DL><DD><p>Initialize the view for the request processing lifecycle.</p> <p>This method must be called at the beginning of the <em>Restore View Phase</em> of the Request Processing Lifecycle.  It is responsible  for performing any per-request initialization necessary to the operation of the lifycecle.</p> <p>The default implementation calls <A HREF="../../../javax/faces/application/ViewHandler.html#calculateCharacterEncoding(javax.faces.context.FacesContext)"><CODE>calculateCharacterEncoding(javax.faces.context.FacesContext)</CODE></A> and passes the result, if non-<code>null</code> into the <A HREF="../../../javax/faces/context/ExternalContext.html#setRequestCharacterEncoding(java.lang.String)"><CODE>ExternalContext.setRequestCharacterEncoding(java.lang.String)</CODE></A> method.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if a problem occurs setting the encoding, such as the <code>UnsupportedEncodingException</code> thrown  by the underlying Servlet or Portlet technology when the encoding is not supported.</DL></DD></DL><HR><A NAME="renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)"><!-- --></A><H3>renderView</H3><PRE>public abstract void <B>renderView</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                                <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component">UIViewRoot</A>&nbsp;viewToRender)                         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>,                                <A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></PRE><DL><DD><p>Perform whatever actions are required to render the response view to the response object associated with the current <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DD><CODE>viewToRender</CODE> - the view to render<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> - if an input/output error occurs<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code> or <code>viewToRender</code> is <code>null</code><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if a servlet error occurs</DL></DD></DL><HR><A NAME="restoreView(javax.faces.context.FacesContext, java.lang.String)"><!-- --></A><H3>restoreView</H3><PRE>public abstract <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component">UIViewRoot</A> <B>restoreView</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>Perform whatever actions are required to restore the view associated with the specified <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> and <code>viewId</code>.  It may delegate to the <code>restoreView</code> of the associated <A HREF="../../../javax/faces/application/StateManager.html" title="class in javax.faces.application"><CODE>StateManager</CODE></A> to do the actual work of restoring the view.  If there is no available state for the specified <code>viewId</code>, return <code>null</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DD><CODE>viewId</CODE> - the view identifier for the current request<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code>  is <code>null</code><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if a servlet error occurs</DL></DD></DL><HR><A NAME="writeState(javax.faces.context.FacesContext)"><!-- --></A><H3>writeState</H3><PRE>public abstract void <B>writeState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)                         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><p>Take any appropriate action to either immediately write out the current state information (by calling <A HREF="../../../javax/faces/application/StateManager.html#writeState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)</CODE></A>, or noting where state information should later be written.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<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> - if an input/output error occurs<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code>  is <code>null</code></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/application/ViewExpiredException.html" title="class in javax.faces.application"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javax/faces/application/ViewHandlerWrapper.html" title="class in javax.faces.application"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javax/faces/application/ViewHandler.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ViewHandler.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 + =
减小字号Ctrl + -
显示快捷键?