Class PageContext

java.lang.Object
javax.servlet.jsp.PageContext
Direct Known Subclasses:
DefaultPageContext

public abstract class PageContext extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Application scope: search only in application
    static final int
    Page scope: (this is the default) - search only in page
    static final int
    Request scope: search only in request
    static final int
    Session scope: search only in session
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Object
    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 void
    forward(String relativeUrlPath)
    This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.
    abstract Object
    Return the object associated with the name in the page scope or null if not found.
    abstract Object
    getAttribute(String name, int scope)
    Return the object associated with the name in the specified scope or null if not found.
    Enumerate all the attributes in a given scope.
    abstract int
    Get the scope where a given attribute is defined.
    abstract Exception
    Return the current value of the exception object (Exception).
    abstract JspWriter
    Return the current JspWriter stream being used for client response.
    abstract Object
    Return the current value of the page object (Servlet).
    abstract javax.servlet.ServletRequest
    Return the current value of the request object (ServletRequest).
    abstract javax.servlet.ServletResponse
    Return the current value of the response object (ServletResponse).
    abstract javax.servlet.ServletConfig
    Return the current value of the config object (ServletConfig).
    abstract javax.servlet.ServletContext
    Return the current value of the context object (ServletContext).
    abstract javax.servlet.http.HttpSession
    Return the current value of the session object (HttpSession).
    abstract void
    This method is intended to process an unhandled "page" level exception.
    abstract void
    This method is intended to process an unhandled "page" level exception.
    abstract void
    include(String relativeUrlPath)
    Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
    abstract void
    include(String relativeUrlPath, boolean flush)
    Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
    abstract void
    initialize(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 void
    This method is called to release all allocated resources.
    abstract void
    Remove the object reference associated with the specified name.
    abstract void
    removeAttribute(String name, int scope)
    Remove the object reference associated with the specified name in the given scope.
    abstract void
    setAttribute(String name, Object attribute)
    Register the name and value specified with page scope semantics.
    abstract void
    setAttribute(String name, Object o, int scope)
    Register the name and value specified with appropriate scope semantics.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PAGE_SCOPE

      public static final int PAGE_SCOPE
      Page scope: (this is the default) - search only in page
      See Also:
    • REQUEST_SCOPE

      public static final int REQUEST_SCOPE
      Request scope: search only in request
      See Also:
    • SESSION_SCOPE

      public static final int SESSION_SCOPE
      Session scope: search only in session
      See Also:
    • APPLICATION_SCOPE

      public static final int APPLICATION_SCOPE
      Application 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

      public abstract Object 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

      public abstract Exception 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

      public abstract JspWriter getOut()
      Return the current JspWriter stream being used for client response.
    • setAttribute

      public abstract void setAttribute(String name, Object attribute)
      Register the name and value specified with page scope semantics.
    • setAttribute

      public abstract void setAttribute(String name, Object o, int scope)
      Register the name and value specified with appropriate scope semantics.
    • getAttribute

      public abstract Object getAttribute(String name)
      Return the object associated with the name in the page scope or null if not found.
    • getAttribute

      public abstract Object getAttribute(String name, int scope)
      Return the object associated with the name in the specified scope or null if not found.
    • findAttribute

      public abstract Object findAttribute(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.
    • removeAttribute

      public abstract void removeAttribute(String name)
      Remove the object reference associated with the specified name.
    • removeAttribute

      public abstract void removeAttribute(String name, int scope)
      Remove the object reference associated with the specified name in the given scope.
    • getAttributesScope

      public abstract int getAttributesScope(String name)
      Get the scope where a given attribute is defined.
    • getAttributeNamesInScope

      public abstract Enumeration<String> getAttributeNamesInScope(int scope)
      Enumerate all the attributes in a given scope.
    • handlePageException

      public abstract void handlePageException(Exception e) throws IOException
      This method is intended to process an unhandled "page" level exception.
      Throws:
      IOException
    • handlePageException

      public abstract void handlePageException(Throwable t) throws IOException
      This method is intended to process an unhandled "page" level exception.
      Throws:
      IOException
    • forward

      public abstract void forward(String relativeUrlPath) throws IOException
      This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.
      Throws:
      IOException
    • include

      public abstract void include(String relativeUrlPath) throws IOException
      Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
      Throws:
      IOException
    • include

      public abstract void include(String relativeUrlPath, boolean flush) throws IOException
      Causes the resource specified to be processed as part of the current ServletRequest and ServletResponse being processed by the calling Thread.
      Throws:
      IOException