📄 package-summary.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.5.0_14) on Mon Jan 28 05:47:08 PST 2008 --><TITLE>javax.servlet.jsp (Java EE 5)</TITLE><META NAME="keywords" CONTENT="javax.servlet.jsp package"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="javax.servlet.jsp (Java EE 5)";}</SCRIPT><NOSCRIPT></NOSCRIPT></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=2 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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </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/http/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../../javax/servlet/jsp/el/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/servlet/jsp/package-summary.html" target="_top"><B>FRAMES</B></A> <A HREF="package-summary.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></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><H2>Package javax.servlet.jsp</H2>Classes and interfaces for the Core JSP 2.1 API.<P><B>See:</B><BR> <A HREF="#package_description"><B>Description</B></A><P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Interface Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/HttpJspPage.html" title="interface in javax.servlet.jsp">HttpJspPage</A></B></TD><TD>The HttpJspPage interface describes the interaction that a JSP Page Implementation Class must satisfy when using the HTTP protocol.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspApplicationContext.html" title="interface in javax.servlet.jsp">JspApplicationContext</A></B></TD><TD>Stores application-scoped information relevant to JSP containers.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspPage.html" title="interface in javax.servlet.jsp">JspPage</A></B></TD><TD>The JspPage interface describes the generic interaction that a JSP Page Implementation class must satisfy; pages that use the HTTP protocol are described by the HttpJspPage interface.</TD></TR></TABLE> <P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Class Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/ErrorData.html" title="class in javax.servlet.jsp">ErrorData</A></B></TD><TD>Contains information about an error, for error pages.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp">JspContext</A></B></TD><TD> <code>JspContext</code> serves as the base class for the PageContext class and abstracts all information that is not specific to servlets.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspEngineInfo.html" title="class in javax.servlet.jsp">JspEngineInfo</A></B></TD><TD>The JspEngineInfo is an abstract class that provides information on the current JSP engine.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspFactory.html" title="class in javax.servlet.jsp">JspFactory</A></B></TD><TD> The JspFactory is an abstract class that defines a number of factory methods available to a JSP page at runtime for the purposes of creating instances of various interfaces and classes used to support the JSP implementation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspWriter.html" title="class in javax.servlet.jsp">JspWriter</A></B></TD><TD> The actions and template data in a JSP page is written using the JspWriter object that is referenced by the implicit variable out which is initialized automatically using methods in the PageContext object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/PageContext.html" title="class in javax.servlet.jsp">PageContext</A></B></TD><TD> PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.</TD></TR></TABLE> <P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Exception Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspException.html" title="class in javax.servlet.jsp">JspException</A></B></TD><TD>A generic exception known to the JSP engine; uncaught JspExceptions will result in an invocation of the errorpage machinery.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/JspTagException.html" title="class in javax.servlet.jsp">JspTagException</A></B></TD><TD>Exception to be used by a Tag Handler to indicate some unrecoverable error.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../javax/servlet/jsp/SkipPageException.html" title="class in javax.servlet.jsp">SkipPageException</A></B></TD><TD>Exception to indicate the calling page must cease evaluation.</TD></TR></TABLE> <P><A NAME="package_description"><!-- --></A><H2>Package javax.servlet.jsp Description</H2><P>Classes and interfaces for the Core JSP 2.1 API.<p>The javax.servlet.jsp package contains a number of classes andinterfaces that describe and define the contracts between a JSP pageimplementation class and the runtime environment provided for aninstance of such a class by a conforming JSP container.</p><h2>JSP Page Implementation Object Contract</h2><p>This section describes the basic contract between a JSP Pageimplementation object and its container.</p><p>The main contract is defined by the classes <A HREF="../../../javax/servlet/jsp/JspPage.html" title="interface in javax.servlet.jsp"><CODE>JspPage</CODE></A>and <A HREF="../../../javax/servlet/jsp/HttpJspPage.html" title="interface in javax.servlet.jsp"><CODE>HttpJspPage</CODE></A>.The <A HREF="../../../javax/servlet/jsp/JspFactory.html" title="class in javax.servlet.jsp"><CODE>JspFactory</CODE></A> class describes the mechanism toportably instantiate all needed runtime objects,and <A HREF="../../../javax/servlet/jsp/JspEngineInfo.html" title="class in javax.servlet.jsp"><CODE>JspEngineInfo</CODE></A> provides basic information onthe current JSP container. Class <A HREF="../../../javax/servlet/jsp/JspApplicationContext.html" title="interface in javax.servlet.jsp"><CODE>JspApplicationContext</CODE></A>stores application-scoped information relevant to JSP containers.It was added in JSP 2.1 to support the integration of the unifiedExpression Language.</p><p>None of these classes are intended to be usedby JSP page authors; an example of how these classes may beused is included below.</p><h2>Implicit Objects</h2>The <A HREF="../../../javax/servlet/jsp/PageContext.html" title="class in javax.servlet.jsp"><CODE>PageContext</CODE></A> object and the <A HREF="../../../javax/servlet/jsp/JspWriter.html" title="class in javax.servlet.jsp"><CODE>JspWriter</CODE></A>are available by default as implicit objects.<h2>Exceptions</h2><p>The <A HREF="../../../javax/servlet/jsp/JspException.html" title="class in javax.servlet.jsp"><CODE>JspException</CODE></A> class is the base class for all JSPexceptions. The <A HREF="../../../javax/servlet/jsp/JspTagException.html" title="class in javax.servlet.jsp"><CODE>JspTagException</CODE></A> and <A HREF="../../../javax/servlet/jsp/SkipPageException.html" title="class in javax.servlet.jsp"><CODE>SkipPageException</CODE></A> exceptions are used by thetag extension mechanism.</p>For JSP error pages, the <A HREF="../../../javax/servlet/jsp/ErrorData.html" title="class in javax.servlet.jsp"><CODE>ErrorData</CODE></A> class encapsulates information about the error.</p><h2>An Implementation Example</h2><p> An instance of an implementation dependent subclass of the<A HREF="../../../javax/servlet/jsp/PageContext.html" title="class in javax.servlet.jsp"><CODE>PageContext</CODE></A> abstract base class can be created by a JSP implementation class atthe beginning of it's <code>_jspService()</code> method via animplementation default <A HREF="../../../javax/servlet/jsp/JspFactory.html" title="class in javax.servlet.jsp"><CODE>JspFactory</CODE></A>.<p>Here is one example of how to use these classes<p><code><pre> public class foo implements Servlet { // ...public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { JspFactory factory = JspFactory.getDefaultFactory(); PageContext pageContext = factory.getPageContext( this, request, response, null, // errorPageURL false, // needsSession JspWriter.DEFAULT_BUFFER, true // autoFlush ); // initialize implicit variables for scripting env ... HttpSession session = pageContext.getSession(); JspWriter out = pageContext.getOut(); Object page = this; try { // body of translated JSP here ... } catch (Exception e) { out.clear(); pageContext.handlePageException(e); } finally { out.close(); factory.releasePageContext(pageContext); }}</pre></code><P><P><DL></DL><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=2 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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </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/http/package-summary.html"><B>PREV PACKAGE</B></A> <A HREF="../../../javax/servlet/jsp/el/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/servlet/jsp/package-summary.html" target="_top"><B>FRAMES</B></A> <A HREF="package-summary.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></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -