📄 jspcontext.html
字号:
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setAttribute(java.lang.String, java.lang.Object)"><!-- --></A><H3>setAttribute</H3><PRE>public abstract void <B>setAttribute</B>(java.lang.String name, java.lang.Object value)</PRE><DL><DD>Register the name and value specified with page scope semantics. If the value passed in is <code>null</code>, this has the same effect as calling <code>removeAttribute( name, PageContext.PAGE_SCOPE )</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to set<DD><CODE>value</CODE> - the value to associate with the name, or null if the attribute is to be removed from the page scope.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null</DL></DD></DL><HR><A NAME="setAttribute(java.lang.String, java.lang.Object, int)"><!-- --></A><H3>setAttribute</H3><PRE>public abstract void <B>setAttribute</B>(java.lang.String name, java.lang.Object value, int scope)</PRE><DL><DD>Register the name and value specified with appropriate scope semantics. If the value passed in is <code>null</code>, this has the same effect as calling <code>removeAttribute( name, scope )</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to set<DD><CODE>value</CODE> - the object to associate with the name, or null if the attribute is to be removed from the specified scope.<DD><CODE>scope</CODE> - the scope with which to associate the name/object<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the scope is invalid<DD><CODE>java.lang.IllegalStateException</CODE> - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.</DL></DD></DL><HR><A NAME="getAttribute(java.lang.String)"><!-- --></A><H3>getAttribute</H3><PRE>public abstract java.lang.Object <B>getAttribute</B>(java.lang.String name)</PRE><DL><DD>Returns the object associated with the name in the page scope or null if not found.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to get<DT><B>Returns:</B><DD>the object associated with the name in the page scope or null if not found.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null</DL></DD></DL><HR><A NAME="getAttribute(java.lang.String, int)"><!-- --></A><H3>getAttribute</H3><PRE>public abstract java.lang.Object <B>getAttribute</B>(java.lang.String name, int scope)</PRE><DL><DD>Return the object associated with the name in the specified scope or null if not found.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to set<DD><CODE>scope</CODE> - the scope with which to associate the name/object<DT><B>Returns:</B><DD>the object associated with the name in the specified scope or null if not found.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the scope is invalid<DD><CODE>java.lang.IllegalStateException</CODE> - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.</DL></DD></DL><HR><A NAME="findAttribute(java.lang.String)"><!-- --></A><H3>findAttribute</H3><PRE>public abstract java.lang.Object <B>findAttribute</B>(java.lang.String name)</PRE><DL><DD>Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to search for<DT><B>Returns:</B><DD>the value associated or null<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null</DL></DD></DL><HR><A NAME="removeAttribute(java.lang.String)"><!-- --></A><H3>removeAttribute</H3><PRE>public abstract void <B>removeAttribute</B>(java.lang.String name)</PRE><DL><DD>Remove the object reference associated with the given name from all scopes. Does nothing if there is no such object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the object to remove.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null</DL></DD></DL><HR><A NAME="removeAttribute(java.lang.String, int)"><!-- --></A><H3>removeAttribute</H3><PRE>public abstract void <B>removeAttribute</B>(java.lang.String name, int scope)</PRE><DL><DD>Remove the object reference associated with the specified name in the given scope. Does nothing if there is no such object.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the object to remove.<DD><CODE>scope</CODE> - The scope where to look.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the scope is invalid<DD><CODE>java.lang.IllegalStateException</CODE> - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.<DD><CODE>java.lang.NullPointerException</CODE> - if the name is null</DL></DD></DL><HR><A NAME="getAttributesScope(java.lang.String)"><!-- --></A><H3>getAttributesScope</H3><PRE>public abstract int <B>getAttributesScope</B>(java.lang.String name)</PRE><DL><DD>Get the scope where a given attribute is defined.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the attribute to return the scope for<DT><B>Returns:</B><DD>the scope of the object associated with the name specified or 0<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if the name is null</DL></DD></DL><HR><A NAME="getAttributeNamesInScope(int)"><!-- --></A><H3>getAttributeNamesInScope</H3><PRE>public abstract java.util.Enumeration <B>getAttributeNamesInScope</B>(int scope)</PRE><DL><DD>Enumerate all the attributes in a given scope.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>scope</CODE> - the scope to enumerate all the attributes for<DT><B>Returns:</B><DD>an enumeration of names (java.lang.String) of all the attributes the specified scope<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the scope is invalid<DD><CODE>java.lang.IllegalStateException</CODE> - if the scope is PageContext.SESSION_SCOPE but the page that was requested does not participate in a session or the session has been invalidated.</DL></DD></DL><HR><A NAME="getOut()"><!-- --></A><H3>getOut</H3><PRE>public abstract <A HREF="../../../javax/servlet/jsp/JspWriter.html" title="class in javax.servlet.jsp">JspWriter</A> <B>getOut</B>()</PRE><DL><DD>The current value of the out object (a JspWriter).<P><DD><DL><DT><B>Returns:</B><DD>the current JspWriter stream being used for client response</DL></DD></DL><HR><A NAME="getExpressionEvaluator()"><!-- --></A><H3>getExpressionEvaluator</H3><PRE>public abstract <A HREF="../../../javax/servlet/jsp/el/ExpressionEvaluator.html" title="class in javax.servlet.jsp.el">ExpressionEvaluator</A> <B>getExpressionEvaluator</B>()</PRE><DL><DD>Provides programmatic access to the ExpressionEvaluator. The JSP Container must return a valid instance of an ExpressionEvaluator that can parse EL expressions.<P><DD><DL><DT><B>Returns:</B><DD>A valid instance of an ExpressionEvaluator.<DT><B>Since:</B></DT> <DD>2.0</DD></DL></DD></DL><HR><A NAME="getVariableResolver()"><!-- --></A><H3>getVariableResolver</H3><PRE>public abstract <A HREF="../../../javax/servlet/jsp/el/VariableResolver.html" title="interface in javax.servlet.jsp.el">VariableResolver</A> <B>getVariableResolver</B>()</PRE><DL><DD>Returns an instance of a VariableResolver that provides access to the implicit objects specified in the JSP specification using this JspContext as the context object.<P><DD><DL><DT><B>Returns:</B><DD>A valid instance of a VariableResolver.<DT><B>Since:</B></DT> <DD>2.0</DD></DL></DD></DL><HR><A NAME="pushBody(java.io.Writer)"><!-- --></A><H3>pushBody</H3><PRE>public <A HREF="../../../javax/servlet/jsp/JspWriter.html" title="class in javax.servlet.jsp">JspWriter</A> <B>pushBody</B>(java.io.Writer writer)</PRE><DL><DD>Return a new JspWriter object that sends output to the provided Writer. Saves the current "out" JspWriter, and updates the value of the "out" attribute in the page scope attribute namespace of the JspContext. <p>The returned JspWriter must implement all methods and behave as though it were unbuffered. More specifically: <ul> <li>clear() must throw an IOException</li> <li>clearBuffer() does nothing</li> <li>getBufferSize() always returns 0</li> <li>getRemaining() always returns 0</li> </ul> </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>writer</CODE> - The Writer for the returned JspWriter to send output to.<DT><B>Returns:</B><DD>a new JspWriter that writes to the given Writer.<DT><B>Since:</B></DT> <DD>2.0</DD></DL></DD></DL><HR><A NAME="popBody()"><!-- --></A><H3>popBody</H3><PRE>public <A HREF="../../../javax/servlet/jsp/JspWriter.html" title="class in javax.servlet.jsp">JspWriter</A> <B>popBody</B>()</PRE><DL><DD>Return the previous JspWriter "out" saved by the matching pushBody(), and update the value of the "out" attribute in the page scope attribute namespace of the JspContext.<P><DD><DL><DT><B>Returns:</B><DD>the saved JspWriter.</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=3 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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JspContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/servlet/jsp/ErrorData.html" title="class in javax.servlet.jsp"><B>PREV CLASS</B></A> <A HREF="../../../javax/servlet/jsp/JspEngineInfo.html" title="class in javax.servlet.jsp"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="JspContext.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -