pagecontext.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 1,122 行 · 第 1/4 页

HTML
1,122
字号
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#findAttribute(java.lang.String)">findAttribute</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Searches for the named attribute in page, request, session (if valid),
 and application scope(s) in order and returns the value associated or
 null.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#forward(java.lang.String)">forward</A></B>(java.lang.String&nbsp;relativeUrlPath)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getAttribute(java.lang.String)">getAttribute</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the object associated with the name in the page scope or null
 if not found.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getAttribute(java.lang.String, int)">getAttribute</A></B>(java.lang.String&nbsp;name,
             int&nbsp;scope)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the object associated with the name in the specified
 scope or null if not found.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.util.Enumeration</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getAttributeNamesInScope(int)">getAttributeNamesInScope</A></B>(int&nbsp;scope)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enumerate all the attributes in a given scope</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getAttributesScope(java.lang.String)">getAttributesScope</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the scope where a given attribute is defined.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.lang.Exception</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getException()">getException</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current value of the exception object (an Exception).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;<A HREF="../../../javax/servlet/jsp/JspWriter.html">JspWriter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getOut()">getOut</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current value of the out object (a JspWriter).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getPage()">getPage</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current value of the page object (a Servlet).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;<A HREF="../../../javax/servlet/ServletRequest.html">ServletRequest</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getRequest()">getRequest</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current value of the request object (a ServletRequest).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;<A HREF="../../../javax/servlet/ServletResponse.html">ServletResponse</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getResponse()">getResponse</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current value of the response object (a ServletResponse).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;<A HREF="../../../javax/servlet/ServletConfig.html">ServletConfig</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getServletConfig()">getServletConfig</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The ServletConfig instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;<A HREF="../../../javax/servlet/ServletContext.html">ServletContext</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getServletContext()">getServletContext</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The ServletContext instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;<A HREF="../../../javax/servlet/http/HttpSession.html">HttpSession</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#getSession()">getSession</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The current value of the session object (an HttpSession).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#handlePageException(java.lang.Exception)">handlePageException</A></B>(java.lang.Exception&nbsp;e)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 This method is intended to process an unhandled "page" level exception
 by redirecting the exception to either the specified error page for this
 JSP, or if none was specified, to perform some implementation dependent
 action.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#handlePageException(java.lang.Throwable)">handlePageException</A></B>(java.lang.Throwable&nbsp;t)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 This method is identical to the handlePageException(Exception),
 except that it accepts a Throwable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#include(java.lang.String)">include</A></B>(java.lang.String&nbsp;relativeUrlPath)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Causes the resource specified to be processed as part of the current
 ServletRequest and ServletResponse being processed by the calling Thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#initialize(javax.servlet.Servlet, javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String, boolean, int, boolean)">initialize</A></B>(<A HREF="../../../javax/servlet/Servlet.html">Servlet</A>&nbsp;servlet,
           <A HREF="../../../javax/servlet/ServletRequest.html">ServletRequest</A>&nbsp;request,
           <A HREF="../../../javax/servlet/ServletResponse.html">ServletResponse</A>&nbsp;response,
           java.lang.String&nbsp;errorPageURL,
           boolean&nbsp;needsSession,
           int&nbsp;bufferSize,
           boolean&nbsp;autoFlush)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 The initialize method is called to initialize an uninitialized PageContext
 so that it may be used by a JSP Implementation class to service an
 incoming request and response within it's _jspService() method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/servlet/jsp/JspWriter.html">JspWriter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#popBody()">popBody</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 PageConxtext</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/servlet/jsp/tagext/BodyContent.html">BodyContent</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#pushBody()">pushBody</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a new BodyContent object, save the current "out" JspWriter,
 and update the value of the "out" attribute in the page scope
 attribute namespace of the PageContext</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#release()">release</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 This method shall "reset" the internal state of a PageContext, releasing
 all internal references, and preparing the PageContext for potential
 reuse by a later invocation of initialize().</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#removeAttribute(java.lang.String)">removeAttribute</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove the object reference associated with the given name,
 look in all scopes in the scope order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#removeAttribute(java.lang.String, int)">removeAttribute</A></B>(java.lang.String&nbsp;name,
                int&nbsp;scope)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove the object reference associated with the specified name
 in the given scope.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute</A></B>(java.lang.String&nbsp;name,
             java.lang.Object&nbsp;attribute)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Register the name and object specified with page scope semantics.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String, java.lang.Object, int)">setAttribute</A></B>(java.lang.String&nbsp;name,
             java.lang.Object&nbsp;o,
             int&nbsp;scope)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;register the name and object specified with appropriate scope semantics</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="PAGE_SCOPE"><!-- --></A><H3>
PAGE_SCOPE</H3>
<PRE>
public static final int <B>PAGE_SCOPE</B></PRE>
<DL>
<DD>Page scope: (this is the default) the named reference remains available
 in this PageContext until the return from the current Servlet.service()
 invocation.</DL>
<HR>

<A NAME="REQUEST_SCOPE"><!-- --></A><H3>
REQUEST_SCOPE</H3>
<PRE>
public static final int <B>REQUEST_SCOPE</B></PRE>
<DL>
<DD>Request scope: the named reference remains available from the ServletRequest
 associated with the Servlet until the current request is completed.</DL>
<HR>

<A NAME="SESSION_SCOPE"><!-- --></A><H3>

⌨️ 快捷键说明

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