Package javax.servlet.jsp
Class DefaultPageContext
java.lang.Object
javax.servlet.jsp.PageContext
javax.servlet.jsp.DefaultPageContext
Default implementation of PageContext for Gumdrop JSP support.
This provides a working implementation of the JSP PageContext class, managing page-scope attributes and providing access to servlet API objects.
- Author:
- Chris Burdess
-
Field Summary
Fields inherited from class javax.servlet.jsp.PageContext
APPLICATION_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE -
Method Summary
Modifier and TypeMethodDescriptionfindAttribute(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.voidThis method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.getAttribute(String name) Return the object associated with the name in the page scope or null if not found.getAttribute(String name, int scope) Return the object associated with the name in the specified scope or null if not found.getAttributeNamesInScope(int scope) Enumerate all the attributes in a given scope.intgetAttributesScope(String name) Get the scope where a given attribute is defined.Return the current value of the exception object (Exception).getOut()Return the current JspWriter stream being used for client response.getPage()Return the current value of the page object (Servlet).javax.servlet.ServletRequestReturn the current value of the request object (ServletRequest).javax.servlet.ServletResponseReturn the current value of the response object (ServletResponse).javax.servlet.ServletConfigReturn the current value of the config object (ServletConfig).javax.servlet.ServletContextReturn the current value of the context object (ServletContext).javax.servlet.http.HttpSessionReturn the current value of the session object (HttpSession).voidThis method is intended to process an unhandled "page" level exception.voidThis method is intended to process an unhandled "page" level exception.voidCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.voidCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.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.voidrelease()This method is called to release all allocated resources.voidremoveAttribute(String name) Remove the object reference associated with the specified name.voidremoveAttribute(String name, int scope) Remove the object reference associated with the specified name in the given scope.voidsetAttribute(String name, Object attribute) Register the name and value specified with page scope semantics.voidsetAttribute(String name, Object o, int scope) Register the name and value specified with appropriate scope semantics.
-
Method Details
-
initialize
public void initialize(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException Description copied from class:PageContextInitialize this PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within the current thread.- Specified by:
initializein classPageContext- Throws:
IOException
-
release
public void release()Description copied from class:PageContextThis method is called to release all allocated resources.- Specified by:
releasein classPageContext
-
getSession
public javax.servlet.http.HttpSession getSession()Description copied from class:PageContextReturn the current value of the session object (HttpSession).- Specified by:
getSessionin classPageContext
-
getPage
Description copied from class:PageContextReturn the current value of the page object (Servlet).- Specified by:
getPagein classPageContext
-
getRequest
public javax.servlet.ServletRequest getRequest()Description copied from class:PageContextReturn the current value of the request object (ServletRequest).- Specified by:
getRequestin classPageContext
-
getResponse
public javax.servlet.ServletResponse getResponse()Description copied from class:PageContextReturn the current value of the response object (ServletResponse).- Specified by:
getResponsein classPageContext
-
getException
Description copied from class:PageContextReturn the current value of the exception object (Exception).- Specified by:
getExceptionin classPageContext
-
getServletConfig
public javax.servlet.ServletConfig getServletConfig()Description copied from class:PageContextReturn the current value of the config object (ServletConfig).- Specified by:
getServletConfigin classPageContext
-
getServletContext
public javax.servlet.ServletContext getServletContext()Description copied from class:PageContextReturn the current value of the context object (ServletContext).- Specified by:
getServletContextin classPageContext
-
getOut
Description copied from class:PageContextReturn the current JspWriter stream being used for client response.- Specified by:
getOutin classPageContext
-
setAttribute
Description copied from class:PageContextRegister the name and value specified with page scope semantics.- Specified by:
setAttributein classPageContext
-
setAttribute
Description copied from class:PageContextRegister the name and value specified with appropriate scope semantics.- Specified by:
setAttributein classPageContext
-
getAttribute
Description copied from class:PageContextReturn the object associated with the name in the page scope or null if not found.- Specified by:
getAttributein classPageContext
-
getAttribute
Description copied from class:PageContextReturn the object associated with the name in the specified scope or null if not found.- Specified by:
getAttributein classPageContext
-
findAttribute
Description copied from class:PageContextSearches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.- Specified by:
findAttributein classPageContext
-
removeAttribute
Description copied from class:PageContextRemove the object reference associated with the specified name.- Specified by:
removeAttributein classPageContext
-
removeAttribute
Description copied from class:PageContextRemove the object reference associated with the specified name in the given scope.- Specified by:
removeAttributein classPageContext
-
getAttributesScope
Description copied from class:PageContextGet the scope where a given attribute is defined.- Specified by:
getAttributesScopein classPageContext
-
getAttributeNamesInScope
Description copied from class:PageContextEnumerate all the attributes in a given scope.- Specified by:
getAttributeNamesInScopein classPageContext
-
handlePageException
Description copied from class:PageContextThis method is intended to process an unhandled "page" level exception.- Specified by:
handlePageExceptionin classPageContext- Throws:
IOException
-
handlePageException
Description copied from class:PageContextThis method is intended to process an unhandled "page" level exception.- Specified by:
handlePageExceptionin classPageContext- Throws:
IOException
-
forward
Description copied from class:PageContextThis method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.- Specified by:
forwardin classPageContext- Throws:
IOException
-
include
Description copied from class:PageContextCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.- Specified by:
includein classPageContext- Throws:
IOException
-
include
Description copied from class:PageContextCauses the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.- Specified by:
includein classPageContext- Throws:
IOException
-