JSPTemplates

org.tp23.jasper.runtime
Class ObjectPageContextImpl

java.lang.Object
  |
  +--org.tp23.jasper.runtime.ObjectPageContextImpl
All Implemented Interfaces:
ObjectPageContext

public class ObjectPageContextImpl
extends java.lang.Object
implements ObjectPageContext

Implementation similar to the PageContext class from the JSP spec. It was written by the authors mentioned and then butchered by Paul Hinds to use it for a different purpose ;)
Basically it is a set of three differnt properties in order of preference...

  • page
  • session
  • application

    Author:
    Anil K. Vijendran, Larry Cable, Hans Bergsten, Paul Hinds

    Field Summary
    protected  java.util.Hashtable attributes
              Description of the Field
    protected  boolean autoFlush
              Description of the Field
    protected  int bufferSize
              Description of the Field
    protected  ObjectConfig config
              Description of the Field
    protected  ObjectContainerContext context
              Description of the Field
    protected  Destination destination
              Description of the Field
    protected  java.lang.String errorPageURL
              Description of the Field
    protected  ObjectJspFactory factory
              Description of the Field
    protected  boolean needsSession
              Description of the Field
    protected  ObjectJspWriter out
              Description of the Field
    protected  java.lang.Object page
              Description of the Field
    protected  JspBase servlet
              Description of the Field
    protected  Session session
              Description of the Field
     
    Fields inherited from interface org.tp23.jsp.ObjectPageContext
    APPLICATION, APPLICATION_SCOPE, CONFIG, DESTINATION, DESTINATION_SCOPE, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, SESSION, SESSION_SCOPE
     
    Method Summary
    protected  ObjectJspWriter _createOut(int bufferSize, boolean autoFlush)
              Description of the Method
     java.lang.Object findAttribute(java.lang.String name)
              Find an attribute lurking in on of the attribute sets.
     void forward(java.lang.String relativeUrlPath)
              Destination.forward()
     java.lang.Object getAttribute(java.lang.String name)
              Gets the attribute attribute of the ObjectPageContextImpl object
     java.lang.Object getAttribute(java.lang.String name, int scope)
              Gets the attribute attribute of the ObjectPageContextImpl object
     java.util.Enumeration getAttributeNamesInScope(int scope)
              Gets the attributeNamesInScope attribute of the ObjectPageContextImpl object
     int getAttributesScope(java.lang.String name)
              Gets the attributesScope attribute of the ObjectPageContextImpl object
     Destination getDestination()
              Gets the destination attribute of the ObjectPageContextImpl object
     java.lang.Exception getException()
              Gets the exception attribute of the ObjectPageContextImpl object
     ObjectConfig getObjectConfig()
              Gets the objectConfig attribute of the ObjectPageContextImpl object
     ObjectContainerContext getObjectContainerContext()
              Gets the servletContext attribute of the ObjectPageContextImpl object
     JspBase getObjectJspBase()
              Gets the objectJspBase attribute of the ObjectPageContextImpl object
     ObjectJspWriter getOut()
              Gets the out attribute of the ObjectPageContextImpl object
     JspBase getPage()
              Gets the page attribute of the ObjectPageContextImpl object
     Session getSession()
              Gets the session attribute of the ObjectPageContextImpl object
     void handlePageException(java.lang.Exception e)
              Description of the Method
     void include(java.lang.String relativeUrlPath)
              Includ a file (performed by Destination why is it here)
     void initialize(JspBase baseJsp, Destination destination, java.lang.String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
               
     ObjectJspWriter popBody()
              Description of the Method
     ObjectJspWriter pushBody()
              Description of the Method
     void release()
               
     void removeAttribute(java.lang.String name)
              remove from ALL attribute sets
     void removeAttribute(java.lang.String name, int scope)
              Remove an attribute from one of the attirbute sets
     void setAttribute(java.lang.String name, java.lang.Object attribute)
              Sets the attribute attribute of the ObjectPageContextImpl object
     void setAttribute(java.lang.String name, java.lang.Object o, int scope)
              Sets the attribute attribute of the ObjectPageContextImpl object
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    destination

    protected Destination destination
    Description of the Field

    servlet

    protected JspBase servlet
    Description of the Field

    config

    protected ObjectConfig config
    Description of the Field

    context

    protected ObjectContainerContext context
    Description of the Field

    factory

    protected ObjectJspFactory factory
    Description of the Field

    needsSession

    protected boolean needsSession
    Description of the Field

    errorPageURL

    protected java.lang.String errorPageURL
    Description of the Field

    autoFlush

    protected boolean autoFlush
    Description of the Field

    bufferSize

    protected int bufferSize
    Description of the Field

    attributes

    protected transient java.util.Hashtable attributes
    Description of the Field

    page

    protected transient java.lang.Object page
    Description of the Field

    session

    protected transient Session session
    Description of the Field

    out

    protected transient ObjectJspWriter out
    Description of the Field
    Method Detail

    setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object attribute)
    Sets the attribute attribute of the ObjectPageContextImpl object
    Specified by:
    setAttribute in interface ObjectPageContext
    Parameters:
    name - The new attribute value
    attribute - The new attribute value

    setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object o,
                             int scope)
    Sets the attribute attribute of the ObjectPageContextImpl object
    Specified by:
    setAttribute in interface ObjectPageContext
    Parameters:
    name - The new attribute value
    o - The new attribute value
    scope - The new attribute value

    getAttribute

    public java.lang.Object getAttribute(java.lang.String name)
    Gets the attribute attribute of the ObjectPageContextImpl object
    Specified by:
    getAttribute in interface ObjectPageContext
    Parameters:
    name - Description of Parameter
    Returns:
    The attribute value

    getAttribute

    public java.lang.Object getAttribute(java.lang.String name,
                                         int scope)
    Gets the attribute attribute of the ObjectPageContextImpl object
    Specified by:
    getAttribute in interface ObjectPageContext
    Parameters:
    name - Description of Parameter
    scope - Description of Parameter
    Returns:
    The attribute value

    getAttributesScope

    public int getAttributesScope(java.lang.String name)
    Gets the attributesScope attribute of the ObjectPageContextImpl object
    Specified by:
    getAttributesScope in interface ObjectPageContext
    Parameters:
    name - Description of Parameter
    Returns:
    The attributesScope value

    getAttributeNamesInScope

    public java.util.Enumeration getAttributeNamesInScope(int scope)
    Gets the attributeNamesInScope attribute of the ObjectPageContextImpl object
    Specified by:
    getAttributeNamesInScope in interface ObjectPageContext
    Parameters:
    scope - Description of Parameter
    Returns:
    The attributeNamesInScope value

    getOut

    public ObjectJspWriter getOut()
    Gets the out attribute of the ObjectPageContextImpl object
    Specified by:
    getOut in interface ObjectPageContext
    Returns:
    The out value

    getSession

    public Session getSession()
    Gets the session attribute of the ObjectPageContextImpl object
    Specified by:
    getSession in interface ObjectPageContext
    Returns:
    The session value

    getObjectJspBase

    public JspBase getObjectJspBase()
    Gets the objectJspBase attribute of the ObjectPageContextImpl object
    Returns:
    The objectJspBase value

    getObjectConfig

    public ObjectConfig getObjectConfig()
    Gets the objectConfig attribute of the ObjectPageContextImpl object
    Specified by:
    getObjectConfig in interface ObjectPageContext
    Returns:
    The objectConfig value

    getObjectContainerContext

    public ObjectContainerContext getObjectContainerContext()
    Gets the servletContext attribute of the ObjectPageContextImpl object
    Specified by:
    getObjectContainerContext in interface ObjectPageContext
    Returns:
    The servletContext value

    getDestination

    public Destination getDestination()
    Gets the destination attribute of the ObjectPageContextImpl object
    Specified by:
    getDestination in interface ObjectPageContext
    Returns:
    The destination value

    getException

    public java.lang.Exception getException()
    Gets the exception attribute of the ObjectPageContextImpl object
    Specified by:
    getException in interface ObjectPageContext
    Returns:
    The exception value

    getPage

    public JspBase getPage()
    Gets the page attribute of the ObjectPageContextImpl object
    Specified by:
    getPage in interface ObjectPageContext
    Returns:
    The page value

    initialize

    public void initialize(JspBase baseJsp,
                           Destination destination,
                           java.lang.String errorPageURL,
                           boolean needsSession,
                           int bufferSize,
                           boolean autoFlush)
                    throws java.io.IOException,
                           java.lang.IllegalStateException,
                           java.lang.IllegalArgumentException
    Specified by:
    initialize in interface ObjectPageContext

    release

    public void release()
    Specified by:
    release in interface ObjectPageContext

    removeAttribute

    public void removeAttribute(java.lang.String name,
                                int scope)
    Remove an attribute from one of the attirbute sets
    Specified by:
    removeAttribute in interface ObjectPageContext
    Parameters:
    name - the attribute key
    scope - session , app , or page scope

    findAttribute

    public java.lang.Object findAttribute(java.lang.String name)
    Find an attribute lurking in on of the attribute sets. the priority is as follows page>session>application
    Specified by:
    findAttribute in interface ObjectPageContext
    Parameters:
    name - the key
    Returns:
    the value if found

    removeAttribute

    public void removeAttribute(java.lang.String name)
    remove from ALL attribute sets
    Specified by:
    removeAttribute in interface ObjectPageContext
    Parameters:
    name - the key

    include

    public void include(java.lang.String relativeUrlPath)
                 throws JspEngineException,
                        java.io.IOException
    Includ a file (performed by Destination why is it here)
    Specified by:
    include in interface ObjectPageContext
    Parameters:
    relativeUrlPath - Description of Parameter

    forward

    public void forward(java.lang.String relativeUrlPath)
                 throws JspEngineException,
                        java.io.IOException
    Destination.forward()
    Specified by:
    forward in interface ObjectPageContext
    Parameters:
    relativeUrlPath - Description of Parameter

    pushBody

    public ObjectJspWriter pushBody()
    Description of the Method
    Specified by:
    pushBody in interface ObjectPageContext
    Returns:
    Description of the Returned Value

    popBody

    public ObjectJspWriter popBody()
    Description of the Method
    Specified by:
    popBody in interface ObjectPageContext
    Returns:
    Description of the Returned Value

    handlePageException

    public void handlePageException(java.lang.Exception e)
                             throws java.io.IOException,
                                    JspEngineException
    Description of the Method
    Specified by:
    handlePageException in interface ObjectPageContext
    Parameters:
    e - the exception
    Throws:
    java.io.IOException -  
    JspEngineException -  

    _createOut

    protected ObjectJspWriter _createOut(int bufferSize,
                                         boolean autoFlush)
                                  throws java.io.IOException,
                                         java.lang.IllegalArgumentException
    Description of the Method
    Parameters:
    bufferSize - Description of Parameter
    autoFlush - Description of Parameter
    Returns:
    Description of the Returned Value
    Throws:
    java.io.IOException - Description of Exception
    java.lang.IllegalArgumentException - Description of Exception

    JSPTemplates