|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.servlet.jsp.PageContext
|
+--org.apache.jasper.runtime.PageContextImpl
Implementation of the PageContext class from the JSP spec.
| Fields inherited from class javax.servlet.jsp.PageContext |
APPLICATION, APPLICATION_SCOPE, CONFIG, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, REQUEST, REQUEST_SCOPE, RESPONSE, SESSION, SESSION_SCOPE |
| Method Summary | |
java.lang.Object |
findAttribute(java.lang.String name)
Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null. |
void |
forward(java.lang.String relativeUrlPath)
This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application. |
java.lang.Object |
getAttribute(java.lang.String name)
return the object associated with the name in the page scope or null |
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
return the object associated with the name in the specifed scope or null |
java.util.Enumeration |
getAttributeNamesInScope(int scope)
|
int |
getAttributesScope(java.lang.String name)
|
java.lang.Exception |
getException()
|
JspWriter |
getOut()
|
java.lang.Object |
getPage()
|
ServletRequest |
getRequest()
|
ServletResponse |
getResponse()
|
Servlet |
getServlet()
|
ServletConfig |
getServletConfig()
|
ServletContext |
getServletContext()
|
HttpSession |
getSession()
|
void |
handlePageException(java.lang.Exception e)
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. |
void |
include(java.lang.String relativeUrlPath)
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread. |
void |
initialize(Servlet servlet,
ServletRequest request,
ServletResponse response,
java.lang.String errorPageURL,
boolean needsSession,
int bufferSize,
boolean autoFlush)
The initialize emthod 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 wihtin it's _jspService() method. |
JspWriter |
popBody()
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 |
BodyContent |
pushBody()
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 |
void |
release()
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(). |
void |
removeAttribute(java.lang.String name)
remove the object reference associated with the specified name |
void |
removeAttribute(java.lang.String name,
int scope)
remove the object reference associated with the specified name |
void |
setAttribute(java.lang.String name,
java.lang.Object attribute)
register the name and object specified with page scope semantics |
void |
setAttribute(java.lang.String name,
java.lang.Object o,
int scope)
register the name and object specified with appropriate scope semantics |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public void initialize(Servlet servlet,
ServletRequest request,
ServletResponse response,
java.lang.String errorPageURL,
boolean needsSession,
int bufferSize,
boolean autoFlush)
throws java.io.IOException,
java.lang.IllegalStateException,
java.lang.IllegalArgumentException
PageContextThe initialize emthod 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 wihtin it's _jspService() method.
This method is typically called from JspFactory.getPageContext() in order to initialize state.
This method is required to create an initial JspWriter, and associate the "out" name in page scope with this newly created object.
initialize in class PageContextjavax.servlet.jsp.PageContextservlet - The Servlet that is associated with this PageContextrequest - The currently pending request for this Servletresponse - The currently pending response for this ServleterrorPageURL - The value of the errorpage attribute from the page directive or nullneedsSession - The value of the session attribute from the page directivebufferSize - The value of the buffer attribute from the page directiveautoFlush - The value of the autoflush attribute from the page directivejava.io.IOException - during creation of JspWriterjava.lang.IllegalStateException - if out not correctly initializedpublic void release()
PageContextThis 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(). This method is typically called from JspFactory.releasePageContext().
subclasses shall envelope this method
release in class PageContextpublic java.lang.Object getAttribute(java.lang.String name)
PageContextreturn the object associated with the name in the page scope or null
getAttribute in class PageContextjavax.servlet.jsp.PageContextname - the name of the attribute to getjava.lang.NullPointerException - if the name is nulljava.lang.IllegalArgumentException - if the scope is invalid
public java.lang.Object getAttribute(java.lang.String name,
int scope)
PageContextreturn the object associated with the name in the specifed scope or null
getAttribute in class PageContextjavax.servlet.jsp.PageContextname - the name of the attribute to setscope - the scope with which to associate the name/objectjava.lang.NullPointerException - if the name is nulljava.lang.IllegalArgumentException - if the scope is invalid
public void setAttribute(java.lang.String name,
java.lang.Object attribute)
PageContextsetAttribute in class PageContextjavax.servlet.jsp.PageContextjava.lang.NullPointerException - if the name or object is null
public void setAttribute(java.lang.String name,
java.lang.Object o,
int scope)
PageContextsetAttribute in class PageContextjavax.servlet.jsp.PageContextname - the name of the attribute to seto - the object to associate with the namescope - the scope with which to associate the name/objectjava.lang.NullPointerException - if the name or object is nulljava.lang.IllegalArgumentException - if the scope is invalid
public void removeAttribute(java.lang.String name,
int scope)
PageContextremoveAttribute in class PageContextpublic int getAttributesScope(java.lang.String name)
getAttributesScope in class PageContextjavax.servlet.jsp.PageContextpublic java.lang.Object findAttribute(java.lang.String name)
PageContextSearches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.
findAttribute in class PageContextjavax.servlet.jsp.PageContextpublic java.util.Enumeration getAttributeNamesInScope(int scope)
getAttributeNamesInScope in class PageContextjavax.servlet.jsp.PageContextpublic void removeAttribute(java.lang.String name)
PageContextremoveAttribute in class PageContextpublic JspWriter getOut()
getOut in class PageContextjavax.servlet.jsp.PageContextpublic HttpSession getSession()
getSession in class PageContextjavax.servlet.jsp.PageContextpublic Servlet getServlet()
public ServletConfig getServletConfig()
getServletConfig in class PageContextjavax.servlet.jsp.PageContextpublic ServletContext getServletContext()
getServletContext in class PageContextjavax.servlet.jsp.PageContextpublic ServletRequest getRequest()
getRequest in class PageContextjavax.servlet.jsp.PageContextpublic ServletResponse getResponse()
getResponse in class PageContextjavax.servlet.jsp.PageContextpublic java.lang.Exception getException()
getException in class PageContextjavax.servlet.jsp.PageContextpublic java.lang.Object getPage()
getPage in class PageContextjavax.servlet.jsp.PageContext
public void include(java.lang.String relativeUrlPath)
throws ServletException,
java.io.IOException
PageContextCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread. The output of the target resources processing of the request is written directly to the ServletResponse output stream.
The current JspWriter "out" for this JSP is flushed as a side-effect of this call, prior to processing the include.
If the relativeUrlPath begins with a "/" then the URL specified
is calculated relative to the DOCROOT of the ServletContext
for this JSP. If the path does not begin with a "/" then the URL
specified is calculated relative to the URL of the request that was
mapped to the calling JSP.
It is only valid to call this method from a Thread
executing within a _jspService(...) method of a JSP.
include in class PageContextjavax.servlet.jsp.PageContextrelativeUrlPath - specifies the relative URL path to the target resource to be includedServletException - java.io.IOException - java.lang.IllegalArgumentException - if the target resource URL is unresolvablejava.lang.SecurityException - if target resource cannot be accessed by caller
public void forward(java.lang.String relativeUrlPath)
throws ServletException,
java.io.IOException
PageContextThis method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.
If the relativeUrlPath begins with a "/" then the URL specified
is calculated relative to the DOCROOT of the ServletContext
for this JSP. If the path does not begin with a "/" then the URL
specified is calculated relative to the URL of the request that was
mapped to the calling JSP.
It is only valid to call this method from a Thread
executing within a _jspService(...) method of a JSP.
Once this method has been called successfully, it is illegal for the
calling Thread to attempt to modify the
ServletResponse object. Any such attempt to do so, shall result
in undefined behavior. Typically, callers immediately return from
_jspService(...) after calling this method.
forward in class PageContextjavax.servlet.jsp.PageContextrelativeUrlPath - specifies the relative URL path to the target resource as described aboveServletException - java.io.IOException - java.lang.IllegalArgumentException - if target resource URL is unresolvablejava.lang.IllegalStateException - if ServletResponse is not in a state where a forward can be performedjava.lang.SecurityException - if target resource cannot be accessed by callerpublic BodyContent pushBody()
PageContextpushBody in class PageContextjavax.servlet.jsp.PageContextpublic JspWriter popBody()
PageContextpopBody in class PageContextjavax.servlet.jsp.PageContext
public void handlePageException(java.lang.Exception e)
throws java.io.IOException,
ServletException
PageContextThis 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.
A JSP implementation class shall typically clean up any local state prior to invoking this and will return immediately thereafter. It is illegal to generate any output to the client, or to modify any ServletResponse state after invoking this call.
handlePageException in class PageContextjavax.servlet.jsp.PageContexte - the exception to be handledServletException - java.io.IOException - java.lang.NullPointerException - if the exception is nulljava.lang.SecurityException - if target resource cannot be accessed by caller
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||