📄 externalcontext.html
字号:
<CODE>abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Map.html" title="class or interface in java.util">Map</A><<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#getSessionMap()">getSessionMap</A></B>()</CODE><BR> Return a mutable <code>Map</code> representing the session scope attributes for the current application.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/security/Principal.html" title="class or interface in java.security">Principal</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#getUserPrincipal()">getUserPrincipal</A></B>()</CODE><BR> Return the <code>Principal</code> object containing the name of the current authenticated user, if any; otherwise, return <code>null</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#isUserInRole(java.lang.String)">isUserInRole</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> role)</CODE><BR> Return <code>true</code> if the currently authenticated user is included in the specified role.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#log(java.lang.String)">log</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> message)</CODE><BR> Log the specified message to the application object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#log(java.lang.String, java.lang.Throwable)">log</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> message, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A> exception)</CODE><BR> Log the specified message and exception to the application object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#redirect(java.lang.String)">redirect</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> url)</CODE><BR> Redirect a request to the specified URL, and cause the <code>responseComplete()</code> method to be called on the <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> instance for the current request.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#setRequest(java.lang.Object)">setRequest</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> request)</CODE><BR> Set the environment-specific request to be returned by subsequent calls to <A HREF="../../../javax/faces/context/ExternalContext.html#getRequest()"><CODE>getRequest()</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#setRequestCharacterEncoding(java.lang.String)">setRequestCharacterEncoding</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> encoding)</CODE><BR> Overrides the name of the character encoding used in the body of this request.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#setResponse(java.lang.Object)">setResponse</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> response)</CODE><BR> Set the environment-specific response to be returned by subsequent calls to <A HREF="../../../javax/faces/context/ExternalContext.html#getResponse()"><CODE>getResponse()</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/context/ExternalContext.html#setResponseCharacterEncoding(java.lang.String)">setResponseCharacterEncoding</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> encoding)</CODE><BR> Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<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></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_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>Field Detail</B></FONT></TH></TR></TABLE><A NAME="BASIC_AUTH"><!-- --></A><H3>BASIC_AUTH</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>BASIC_AUTH</B></PRE><DL><DD><p>String identifier for BASIC authentication.</p><P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.context.ExternalContext.BASIC_AUTH">Constant Field Values</A></DL></DL><HR><A NAME="CLIENT_CERT_AUTH"><!-- --></A><H3>CLIENT_CERT_AUTH</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>CLIENT_CERT_AUTH</B></PRE><DL><DD><p>String identifier for CLIENT_CERT authentication.</p><P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.context.ExternalContext.CLIENT_CERT_AUTH">Constant Field Values</A></DL></DL><HR><A NAME="DIGEST_AUTH"><!-- --></A><H3>DIGEST_AUTH</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>DIGEST_AUTH</B></PRE><DL><DD><p>String identifier for DIGEST authentication.</p><P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.context.ExternalContext.DIGEST_AUTH">Constant Field Values</A></DL></DL><HR><A NAME="FORM_AUTH"><!-- --></A><H3>FORM_AUTH</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>FORM_AUTH</B></PRE><DL><DD><p>String identifier for FORM authentication.</p><P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.context.ExternalContext.FORM_AUTH">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="ExternalContext()"><!-- --></A><H3>ExternalContext</H3><PRE>public <B>ExternalContext</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="dispatch(java.lang.String)"><!-- --></A><H3>dispatch</H3><PRE>public abstract void <B>dispatch</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path) 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>Dispatch a request to the specified resource to create output for this response.</p> <p><em>Servlet:</em> This must be accomplished by calling the <code>javax.servlet.ServletContext</code> method <code>getRequestDispatcher(path)</code>, and calling the <code>forward()</code> method on the resulting object.</p> <p><em>Portlet:</em> This must be accomplished by calling the <code>javax.portlet.PortletContext</code> method <code>getRequestDispatcher()</code>, and calling the <code>include()</code> method on the resulting object.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>path</CODE> - Context relative path to the specified resource, which must start with a slash ("/") character<DT><B>Throws:</B><DD><CODE>FacesException</CODE> - thrown if a <code>ServletException</code> or <code>PortletException</code> occurs<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 no request dispatcher can be created for the specified path<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called in a portlet environment, and the current request is an <code>ActionRequest</code> instead of a <code>RenderRequest</code><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>path</code> is <code>null</code></DL></DD></DL><HR><A NAME="encodeActionURL(java.lang.String)"><!-- --></A><H3>encodeActionURL</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>encodeActionURL</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> url)</PRE><DL><DD><p>Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable action in the current application.<p> <p><em>Servlet:</em> This must be the value returned by the <code>javax.servlet.http.HttpServletResponse</code> method <code>encodeURL(url)</code>.</p> <p><em>Portlet:</em> This must be the value returned by the <code>javax.portlet.PortletResponse</code> method <code>encodeURL(url)</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - The input URL to be encoded<DT><B>Throws:</B>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -