Package javax.servlet.jsp
Class PageContext
java.lang.Object
javax.servlet.jsp.PageContext
- Direct Known Subclasses:
DefaultPageContext
Minimal JSP PageContext implementation for Gumdrop JSP support.
This provides the essential functionality of the JSP PageContext class, which serves as a repository for JSP page-scope objects and provides access to servlet API objects.
- Author:
- Chris Burdess
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intApplication scope: search only in applicationstatic final intPage scope: (this is the default) - search only in pagestatic final intRequest scope: search only in requeststatic final intSession scope: search only in session -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ObjectfindAttribute(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.abstract voidThis method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.abstract ObjectgetAttribute(String name) Return the object associated with the name in the page scope or null if not found.abstract ObjectgetAttribute(String name, int scope) Return the object associated with the name in the specified scope or null if not found.abstract Enumeration<String>getAttributeNamesInScope(int scope) Enumerate all the attributes in a given scope.abstract intgetAttributesScope(String name) Get the scope where a given attribute is defined.abstract ExceptionReturn the current value of the exception object (Exception).abstract JspWritergetOut()Return the current JspWriter stream being used for client response.abstract ObjectgetPage()Return the current value of the page object (Servlet).abstract javax.servlet.ServletRequestReturn the current value of the request object (ServletRequest).abstract javax.servlet.ServletResponseReturn the current value of the response object (ServletResponse).abstract javax.servlet.ServletConfigReturn the current value of the config object (ServletConfig).abstract javax.servlet.ServletContextReturn the current value of the context object (ServletContext).abstract javax.servlet.http.HttpSessionReturn the current value of the session object (HttpSession).abstract voidThis method is intended to process an unhandled "page" level exception.abstract voidThis method is intended to process an unhandled "page" level exception.abstract voidCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.abstract voidCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.abstract voidinitialize(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) Initialize this PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within the current thread.abstract voidrelease()This method is called to release all allocated resources.abstract voidremoveAttribute(String name) Remove the object reference associated with the specified name.abstract voidremoveAttribute(String name, int scope) Remove the object reference associated with the specified name in the given scope.abstract voidsetAttribute(String name, Object attribute) Register the name and value specified with page scope semantics.abstract voidsetAttribute(String name, Object o, int scope) Register the name and value specified with appropriate scope semantics.
-
Field Details
-
PAGE_SCOPE
public static final int PAGE_SCOPEPage scope: (this is the default) - search only in page- See Also:
-
REQUEST_SCOPE
public static final int REQUEST_SCOPERequest scope: search only in request- See Also:
-
SESSION_SCOPE
public static final int SESSION_SCOPESession scope: search only in session- See Also:
-
APPLICATION_SCOPE
public static final int APPLICATION_SCOPEApplication scope: search only in application- See Also:
-
-
Constructor Details
-
PageContext
public PageContext()
-
-
Method Details
-
initialize
public abstract void initialize(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException Initialize this PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within the current thread.- Throws:
IOException
-
release
public abstract void release()This method is called to release all allocated resources. -
getSession
public abstract javax.servlet.http.HttpSession getSession()Return the current value of the session object (HttpSession). -
getPage
Return the current value of the page object (Servlet). -
getRequest
public abstract javax.servlet.ServletRequest getRequest()Return the current value of the request object (ServletRequest). -
getResponse
public abstract javax.servlet.ServletResponse getResponse()Return the current value of the response object (ServletResponse). -
getException
Return the current value of the exception object (Exception). -
getServletConfig
public abstract javax.servlet.ServletConfig getServletConfig()Return the current value of the config object (ServletConfig). -
getServletContext
public abstract javax.servlet.ServletContext getServletContext()Return the current value of the context object (ServletContext). -
getOut
Return the current JspWriter stream being used for client response. -
setAttribute
Register the name and value specified with page scope semantics. -
setAttribute
Register the name and value specified with appropriate scope semantics. -
getAttribute
Return the object associated with the name in the page scope or null if not found. -
getAttribute
Return the object associated with the name in the specified scope or null if not found. -
findAttribute
Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null. -
removeAttribute
Remove the object reference associated with the specified name. -
removeAttribute
Remove the object reference associated with the specified name in the given scope. -
getAttributesScope
Get the scope where a given attribute is defined. -
getAttributeNamesInScope
Enumerate all the attributes in a given scope. -
handlePageException
This method is intended to process an unhandled "page" level exception.- Throws:
IOException
-
handlePageException
This method is intended to process an unhandled "page" level exception.- Throws:
IOException
-
forward
This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.- Throws:
IOException
-
include
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.- Throws:
IOException
-
include
Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.- Throws:
IOException
-