externalcontext.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 1,213 行 · 第 1/5 页
HTML
1,213 行
<DD><DL></DL></DD></DL><HR><A NAME="setRequest(java.lang.Object)"><!-- --></A><H3>setRequest</H3><PRE>public void <B>setRequest</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)</PRE><DL><DD><p>Set the environment-specific request to be returned by subsequent calls to <A HREF="../../../javax/faces/context/ExternalContext.html#getRequest()"><CODE>getRequest()</CODE></A>. This may be used to install a wrapper for the request.</p> <p>The default implementation throws <code>UnsupportedOperationException</code> and is provided for the sole purpose of not breaking existing applications that extend this class.</p><P><DD><DL><DT><B>Since:</B></DT> <DD>1.2</DD></DL></DD></DL><HR><A NAME="setRequestCharacterEncoding(java.lang.String)"><!-- --></A><H3>setRequestCharacterEncoding</H3><PRE>public void <B>setRequestCharacterEncoding</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) throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/UnsupportedEncodingException.html" title="class or interface in java.io">UnsupportedEncodingException</A></PRE><DL><DD><p>Overrides the name of the character encoding used in the body of this request.</p> <p>Calling this method after the request has been accessed will have no no effect, unless a <code>Reader</code> or <code>Stream</code> has been obtained from the request, in which case an <code>IllegalStateException</code> is thrown.</p> <p><em>Servlet:</em> This must call through to the <code>javax.servlet.ServletRequest</code> method <code>setCharacterEncoding()</code>.</p> <p><em>Portlet:</em> This must call through to the <code>javax.portlet.ActionRequest</code> method <code>setCharacterEncoding()</code>.</p> <p>The default implementation throws <code>UnsupportedOperationException</code> and is provided for the sole purpose of not breaking existing applications that extend this class.</p><P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/UnsupportedEncodingException.html" title="class or interface in java.io">UnsupportedEncodingException</A></CODE> - if this is not a valid encoding<DT><B>Since:</B></DT> <DD>1.2</DD></DL></DD></DL><HR><A NAME="getRequestContextPath()"><!-- --></A><H3>getRequestContextPath</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>getRequestContextPath</B>()</PRE><DL><DD><p>Return the portion of the request URI that identifies the web application context for this request.</p> <p><em>Servlet:</em> This must be the value returned by the <code>javax.servlet.http.HttpServletRequest</code> method <code>getContextPath()</code>.</p> <p><em>Portlet:</em> This must be the value returned by the <code>javax.portlet.PortletRequest</code> method <code>getContextPath()</code>.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequestCookieMap()"><!-- --></A><H3>getRequestCookieMap</H3><PRE>public 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>> <B>getRequestCookieMap</B>()</PRE><DL><DD><p>Return an immutable <code>Map</code> whose keys are the set of cookie names included in the current request, and whose values (of type <code>javax.servlet.http.Cookie</code>) are the first (or only) cookie for each cookie name returned by the underlying request. The returned <code>Map</code> must implement the entire contract for an unmodifiable map as described in the JavaDocs for <code>java.util.Map</code>.</p> <p><em>Servlet:</em> This must be the value returned by the <code>javax.servlet.http.HttpServletRequest</code> method <code>getCookies()</code>, unless <code>null</code> was returned, in which case this must be a zero-length array.</p> <p><em>Portlet:</em> Ths must be an empty Map.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequestHeaderMap()"><!-- --></A><H3>getRequestHeaderMap</H3><PRE>public 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/String.html" title="class or interface in java.lang">String</A>> <B>getRequestHeaderMap</B>()</PRE><DL><DD><p>Return an immutable <code>Map</code> whose keys are the set of request header names included in the current request, and whose values (of type String) are the first (or only) value for each header name returned by the underlying request. The returned <code>Map</code> must implement the entire contract for an unmodifiable map as described in the JavaDocs for <code>java.util.Map</code>. In addition, key comparisons must be performed in a case insensitive manner.</p> <p><em>Servlet:</em> This must be the set of headers available via the <code>javax.servlet.http.HttpServletRequest</code> methods <code>getHeader()</code> and <code>getHeaderNames()</code>.</p> <p><em>Portlet:</em> This must be the set of properties available via the <code>javax.portlet.PortletRequest</code> methods <code>getProperty()</code> and <code>getPropertyNames()</code>. As such, HTTP headers will only be included if they were provided by the portlet container, and additional properties provided by the portlet container may also be included.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequestHeaderValuesMap()"><!-- --></A><H3>getRequestHeaderValuesMap</H3><PRE>public 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/String.html" title="class or interface in java.lang">String</A>[]> <B>getRequestHeaderValuesMap</B>()</PRE><DL><DD><p>Return an immutable <code>Map</code> whose keys are the set of request header names included in the current request, and whose values (of type String[]) are all of the value for each header name returned by the underlying request. The returned <code>Map</code> must implement the entire contract for an unmodifiable map as described in the JavaDocs for <code>java.util.Map</code>. In addition, key comparisons must be performed in a case insensitive manner.</p> <p><em>Servlet:</em> This must be the set of headers available via the <code>javax.servlet.http.HttpServletRequest</code> methods <code>getHeaders()</code> and <code>getHeaderNames()</code>.</p> <p><em>Portlet:</em> This must be the set of properties available via the <code>javax.portlet.PortletRequest</code> methods <code>getProperties()</code> and <code>getPropertyNames()</code>. As such, HTTP headers will only be included if they were provided by the portlet container, and additional properties provided by the portlet container may also be included.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequestLocale()"><!-- --></A><H3>getRequestLocale</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A> <B>getRequestLocale</B>()</PRE><DL><DD><p>Return the preferred <code>Locale</code> in which the client will accept content.</p> <p><em>Servlet:</em> This must be the value returned by the <code>javax.servlet.ServletRequest</code> method <code>getLocale()</code>.</p> <p><em>Portlet:</em> This must be the value returned by the <code>javax.portlet.PortletRequest</code> method <code>getLocale()</code>.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequestLocales()"><!-- --></A><H3>getRequestLocales</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A><<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A>> <B>getRequestLocales</B>()</PRE><DL><DD><p>Return an <code>Iterator</code> over the preferred <code>Locale</code>s specified in the request, in decreasing order of preference.</p> <p><em>Servlet:</em> This must be an <code>Iterator</code> over the values returned by the <code>javax.servlet.ServletRequest</code> method <code>getLocales()</code>.</p> <p><em>Portlet:</em> This must be an <code>Iterator</code> over the values returned by the <code>javax.portlet.PortletRequest</code> method <code>getLocales()</code>.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequestMap()"><!-- --></A><H3>getRequestMap</H3><PRE>public 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>> <B>getRequestMap</B>()</PRE><DL><DD><p>Return a mutable <code>Map</code> representing the request scope attributes for the current application. The returned <code>Map</code> must implement the entire contract for a modifiable map as described in the JavaDocs for <code>java.util.Map</code>. Modifications made in the <code>Map</code> must cause the corresponding changes in the set of request scope attributes. Particularly the <code>clear()</code>, <code>remove()</code>, <code>put()</code>, <code>putAll()</code>, and <code>get()</code> operations must take the appropriate action on the underlying data structure.</p> <p>For any of the <code>Map</code> methods that cause an element to be removed from the underlying data structure, the following action regarding managed-beans must be taken. If the element to be removed is a managed-bean, and it
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?