externalcontext.html

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

HTML
1,213
字号
<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>url</code>  is <code>null</code></DL></DD></DL><HR><A NAME="encodeNamespace(java.lang.String)"><!-- --></A><H3>encodeNamespace</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>encodeNamespace</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>&nbsp;name)</PRE><DL><DD><p>Return the specified name, after prefixing it with a namespace that ensures that it will be unique within the context of a particular page.</p> <p><em>Servlet:</em> The input value must be returned unchanged.</p> <p><em>Portlet:</em> The returned value must be the input value prefixed by the value returned by the <code>javax.portlet.RenderResponse</code> method <code>getNamespace()</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - Name to be encoded<DT><B>Throws:</B><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 response is an <code>ActionResponse</code>  instead of a <code>RenderResponse</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>name</code>  is <code>null</code></DL></DD></DL><HR><A NAME="encodeResourceURL(java.lang.String)"><!-- --></A><H3>encodeResourceURL</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>encodeResourceURL</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>&nbsp;url)</PRE><DL><DD><p>Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable resource 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><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>url</code>  is <code>null</code></DL></DD></DL><HR><A NAME="getApplicationMap()"><!-- --></A><H3>getApplicationMap</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>&lt;<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>&gt; <B>getApplicationMap</B>()</PRE><DL><DD><p>Return a mutable <code>Map</code> representing the application 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 application 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 has one or more public no-argument void return methods annotated with <code>javax.annotation.PreDestroy</code>, each such method must be called before the element is removed from the underlying data structure.  Elements that are not managed-beans, but do happen to have methods with that annotation must not have those methods called on removal.  Any exception thrown by the <code>PreDestroy</code> annotated methods must by caught and not rethrown.  The exception may be logged.</p> <p><em>Servlet:</em>  This must be the set of attributes available via the <code>javax.servlet.ServletContext</code> methods <code>getAttribute()</code>, <code>getAttributeNames()</code>, <code>removeAttribute()</code>, and <code>setAttribute()</code>.</p> <p><em>Portlet:</em>  This must be the set of attributes available via the <code>javax.portlet.PortletContext</code> methods <code>getAttribute()</code>, <code>getAttributeNames()</code>, <code>removeAttribute()</code>, and <code>setAttribute()</code>.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getAuthType()"><!-- --></A><H3>getAuthType</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>getAuthType</B>()</PRE><DL><DD><p>Return the name of the authentication scheme used to authenticate the current user, if any; otherwise, return <code>null</code>. For standard authentication schemes, the returned value will match one of the following constants: <code>BASIC_AUTH</code>, <code>CLIENT_CERT_AUTH</code>, <code>DIGEST_AUTH</code>, or <code>FORM_AUTH</code>.</p> <p><em>Servlet:</em> This must be the value returned by the <code>javax.servlet.http.HttpServletRequest</code> method <code>getAuthType()</code>.</p> <p><em>Portlet:</em> This must be the value returned by the <code>javax.portlet.http.PortletRequest</code> method <code>getAuthType()</code>.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getContext()"><!-- --></A><H3>getContext</H3><PRE>public abstract <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>getContext</B>()</PRE><DL><DD><p>Return the application environment object instance for the current appication.</p> <p><em>Servlet:</em>  This must be the current application's <code>javax.servlet.ServletContext</code> instance.</p> <p><em>Portlet:</em>  This must be the current application's <code>javax.portlet.PortletContext</code> instance.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getInitParameter(java.lang.String)"><!-- --></A><H3>getInitParameter</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>getInitParameter</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>&nbsp;name)</PRE><DL><DD><p>Return the value of the specified application initialization parameter (if any).</p> <p><em>Servlet:</em> This must be the result of the <code>javax.servlet.ServletContext</code> method <code>getInitParameter(name)</code>.</p> <p><em>Portlet:</em> This must be the result of the <code>javax.portlet.PortletContext</code> method <code>getInitParameter(name)</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - Name of the requested initialization parameter<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>name</code>  is <code>null</code></DL></DD></DL><HR><A NAME="getInitParameterMap()"><!-- --></A><H3>getInitParameterMap</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> <B>getInitParameterMap</B>()</PRE><DL><DD><p>Return an immutable <code>Map</code> whose keys are the set of application initialization parameter names configured for this application, and whose values are the corresponding parameter values.  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 result must be as if it were synthesized by calling the <code>javax.servlet.ServletContext</code> method <code>getInitParameterNames</code>, and putting each configured parameter name/value pair into the result.</p> <p><em>Portlet:</em> This result must be as if it were synthesized by calling the <code>javax.portlet.PortletContext</code> method <code>getInitParameterNames</code>, and putting each configured parameter name/value pair into the result.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRemoteUser()"><!-- --></A><H3>getRemoteUser</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>getRemoteUser</B>()</PRE><DL><DD><p>Return the login name of the user making the current request if any; otherwise, return <code>null</code>.</p> <p><em>Servlet:</em> This must be the value returned by the <code>javax.servlet.http.HttpServletRequest</code> method <code>getRemoteUser()</code>.</p> <p><em>Portlet:</em> This must be the value returned by the <code>javax.portlet.http.PortletRequest</code> method <code>getRemoteUser()</code>.</p><P><DD><DL></DL></DD></DL><HR><A NAME="getRequest()"><!-- --></A><H3>getRequest</H3><PRE>public abstract <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>getRequest</B>()</PRE><DL><DD><p>Return the environment-specific object instance for the current request.</p> <p><em>Servlet:</em>  This must be the current request's <code>javax.servlet.http.HttpServletRequest</code> instance.</p> <p><em>Portlet:</em>  This must be the current request's <code>javax.portlet.PortletRequest</code> instance, which will be either an <code>ActionRequest</code> or a <code>RenderRequest</code> depending upon when this method is called.</p><P>

⌨️ 快捷键说明

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