📄 pagecontext.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2) on Thu Oct 16 19:57:34 EDT 2003 --><TITLE>PageContext (JavaServer Pages API Documentation)</TITLE><META NAME="keywords" CONTENT="javax.servlet.jsp.PageContext class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="PageContext (JavaServer Pages API Documentation)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_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/PageContext.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/JspWriter.html" title="class in javax.servlet.jsp"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="PageContext.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 | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.servlet.jsp</FONT><BR>Class PageContext</H2><PRE>java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp">javax.servlet.jsp.JspContext</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>javax.servlet.jsp.PageContext</B></PRE><HR><DL><DT>public abstract class <B>PageContext</B><DT>extends <A HREF="../../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp">JspContext</A></DL><P><p> PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment. <p> A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details. Implicit objects are added to the pageContext automatically. <p> The <code> PageContext </code> class is an abstract class, designed to be extended to provide implementation dependent implementations thereof, by conformant JSP engine runtime environments. A PageContext instance is obtained by a JSP implementation class by calling the JspFactory.getPageContext() method, and is released by calling JspFactory.releasePageContext(). <p> An example of how PageContext, JspFactory, and other classes can be used within a JSP Page Implementation object is given elsewhere. <p> The PageContext provides a number of facilities to the page/component author and page implementor, including: <ul> <li>a single API to manage the various scoped namespaces <li>a number of convenience API's to access various public objects <li>a mechanism to obtain the JspWriter for output <li>a mechanism to manage session usage by the page <li>a mechanism to expose page directive attributes to the scripting environment <li>mechanisms to forward or include the current request to other active components in the application <li>a mechanism to handle errorpage exception processing </ul> <p><B>Methods Intended for Container Generated Code</B> <p>Some methods are intended to be used by the code generated by the container, not by code written by JSP page authors, or JSP tag library authors. <p>The methods supporting <B>lifecycle</B> are <code>initialize()</code> and <code>release()</code> <p> The following methods enable the <B>management of nested</B> JspWriter streams to implement Tag Extensions: <code>pushBody()</code> <p><B>Methods Intended for JSP authors</B> <p> The following methods provide <B>convenient access</B> to implicit objects: <code>getException()</code>, <code>getPage()</code> <code>getRequest()</code>, <code>getResponse()</code>, <code>getSession()</code>, <code>getServletConfig()</code> and <code>getServletContext()</code>. <p> The following methods provide support for <B>forwarding, inclusion and error handling</B>: <code>forward()</code>, <code>include()</code>, and <code>handlePageException()</code>.<P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#APPLICATION">APPLICATION</A></B></CODE><BR> Name used to store ServletContext in PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#APPLICATION_SCOPE">APPLICATION_SCOPE</A></B></CODE><BR> Application scope: named reference remains available in the ServletContext until it is reclaimed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#CONFIG">CONFIG</A></B></CODE><BR> Name used to store ServletConfig in PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#EXCEPTION">EXCEPTION</A></B></CODE><BR> Name used to store uncaught exception in ServletRequest attribute list and PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#OUT">OUT</A></B></CODE><BR> Name used to store current JspWriter in PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#PAGE">PAGE</A></B></CODE><BR> Name used to store the Servlet in this PageContext's nametables.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#PAGE_SCOPE">PAGE_SCOPE</A></B></CODE><BR> Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#PAGECONTEXT">PAGECONTEXT</A></B></CODE><BR> Name used to store this PageContext in it's own name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#REQUEST">REQUEST</A></B></CODE><BR> Name used to store ServletRequest in PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#REQUEST_SCOPE">REQUEST_SCOPE</A></B></CODE><BR> Request scope: the named reference remains available from the ServletRequest associated with the Servlet until the current request is completed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#RESPONSE">RESPONSE</A></B></CODE><BR> Name used to store ServletResponse in PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#SESSION">SESSION</A></B></CODE><BR> Name used to store HttpSession in PageContext name table.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/servlet/jsp/PageContext.html#SESSION_SCOPE">SESSION_SCOPE</A></B></CODE><BR> Session scope (only valid if this page participates in a session): the named reference remains available from the HttpSession (if any) associated with the Servlet until the HttpSession is invalidated.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -