com.caucho.jsp
Class QPageContext

java.lang.Object
  |
  +--javax.servlet.jsp.PageContext
        |
        +--com.caucho.jsp.QPageContext

public class QPageContext
extends PageContext


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)
          Finds an attribute in any of the scopes from page to application.
 void forward(java.lang.String relativeUrl)
          Forward a subrequest relative to the current url.
 java.lang.Object getAttribute(java.lang.String name)
          Return the object associated with the name in the page scope or null if not found.
 java.lang.Object getAttribute(java.lang.String name, int scope)
          Return the object associated with the name in the specified scope or null if not found.
 java.util.Enumeration getAttributeNames()
           
 java.util.Enumeration getAttributeNames(int scope)
           
 java.util.Enumeration getAttributeNamesInScope(int scope)
          Enumerate all the attributes in a given scope
 int getAttributesScope(java.lang.String name)
          Get the scope where a given attribute is defined.
 java.lang.String getErrorPage()
          Returns the page's error page.
 java.lang.Exception getException()
          The current value of the exception object (an Exception).
 JspWriter getOut()
          Returns the current writer.
 java.lang.Object getPage()
          Returns the underlying servlet for the page.
 ServletRequest getRequest()
          Returns the servlet request for the page.
 ServletResponse getResponse()
          Returns the servlet response for the page.
 ServletConfig getServletConfig()
          The ServletConfig instance.
 ServletContext getServletContext()
          Returns the page's servlet context.
 HttpSession getSession()
          The current value of the session object (an HttpSession).
 java.lang.Throwable getThrowable()
          Returns the Throwable stored by the error page.
 void handlePageException(java.lang.Exception e)
          Handles an exception caught in the JSP page.
 void handlePageException(java.lang.Throwable e)
          Handles an exception caught in the JSP page.
 void include(java.lang.String relativeUrl)
          Include another servlet into the current output stream.
 void initialize(Servlet servlet, ServletRequest request, ServletResponse response, java.lang.String errorPage, boolean needsSession, int bufferSize, boolean autoFlush)
           The initialize method 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 within it's _jspService() method.
 JspWriter popBody()
          Pops the BodyContent from the JspWriter stack.
 BodyContent pushBody()
          Pushes a new BodyContent onto the JspWriter stack.
 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 releaseBody(QBodyContent out)
           
 void removeAttribute(java.lang.String name)
          Removes a named attribute from the page context.
 void removeAttribute(java.lang.String name, int scope)
          Remove the object reference associated with the specified name in the given scope.
 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 value, int scope)
          register the name and object specified with appropriate scope semantics
 void setErrorPage(java.lang.String errorPage)
          Sets the page's error page.
 void write(byte[] buffer, int offset, int length)
          Prints bytes to the current write stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public void initialize(Servlet servlet,
                       ServletRequest request,
                       ServletResponse response,
                       java.lang.String errorPage,
                       boolean needsSession,
                       int bufferSize,
                       boolean autoFlush)
Description copied from class: PageContext

The initialize method 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 within 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.

This method should not be used by page or tag library authors.

Overrides:
initialize in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
servlet - The Servlet that is associated with this PageContext
request - The currently pending request for this Servlet
response - The currently pending response for this Servlet
errorPageURL - The value of the errorpage attribute from the page directive or null
needsSession - The value of the session attribute from the page directive
bufferSize - The value of the buffer attribute from the page directive
autoFlush - The value of the autoflush attribute from the page directive
Throws:
java.io.IOException - during creation of JspWriter
java.lang.IllegalStateException - if out not correctly initialized

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from class: PageContext
Return the object associated with the name in the page scope or null if not found.
Overrides:
getAttribute in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
name - the name of the attribute to get
Throws:
NullPointerException - if the name is null
java.lang.IllegalArgumentException - if the scope is invalid

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object attribute)
Description copied from class: PageContext
Register the name and object specified with page scope semantics.
Overrides:
setAttribute in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
name - the name of the attribute to set
attribute - the object to associate with the name
Throws:
NullPointerException - if the name or object is null

removeAttribute

public void removeAttribute(java.lang.String name)
Removes a named attribute from the page context.
Overrides:
removeAttribute in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
name - The name of the object to remove.

getAttributeNames

public java.util.Enumeration getAttributeNames()

getAttribute

public java.lang.Object getAttribute(java.lang.String name,
                                     int scope)
Description copied from class: PageContext
Return the object associated with the name in the specified scope or null if not found.
Overrides:
getAttribute in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
name - the name of the attribute to set
scope - the scope with which to associate the name/object
Throws:
NullPointerException - if the name is null
java.lang.IllegalArgumentException - if the scope is invalid

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value,
                         int scope)
Description copied from class: PageContext
register the name and object specified with appropriate scope semantics
Overrides:
setAttribute in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
name - the name of the attribute to set
o - the object to associate with the name
scope - the scope with which to associate the name/object
Throws:
NullPointerException - if the name or object is null
java.lang.IllegalArgumentException - if the scope is invalid

removeAttribute

public void removeAttribute(java.lang.String name,
                            int scope)
Description copied from class: PageContext
Remove the object reference associated with the specified name in the given scope.
Overrides:
removeAttribute in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Parameters:
name - The name of the object to remove.
scope - The scope where to look.

getAttributeNames

public java.util.Enumeration getAttributeNames(int scope)

getAttributeNamesInScope

public java.util.Enumeration getAttributeNamesInScope(int scope)
Description copied from class: PageContext
Enumerate all the attributes in a given scope
Overrides:
getAttributeNamesInScope in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
an enumeration of names (java.lang.String) of all the attributes the specified scope

findAttribute

public java.lang.Object findAttribute(java.lang.String name)
Finds an attribute in any of the scopes from page to application.
Overrides:
findAttribute in class PageContext
Parameters:
name - the attribute name.
Returns:
the attribute value

getAttributesScope

public int getAttributesScope(java.lang.String name)
Description copied from class: PageContext
Get the scope where a given attribute is defined.
Overrides:
getAttributesScope in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the scope of the object associated with the name specified or 0

getOut

public JspWriter getOut()
Returns the current writer.
Overrides:
getOut in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the current JspWriter stream being used for client response

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws java.io.IOException
Prints bytes to the current write stream.
Parameters:
buffer - byte buffer for the data
offset - start offset into the data
length - length of data to write

pushBody

public BodyContent pushBody()
Pushes a new BodyContent onto the JspWriter stack.
Overrides:
pushBody in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the new BodyContent

popBody

public JspWriter popBody()
Pops the BodyContent from the JspWriter stack.
Overrides:
popBody in class PageContext
Returns:
the enclosing writer

releaseBody

public void releaseBody(QBodyContent out)
                 throws java.io.IOException

getPage

public java.lang.Object getPage()
Returns the underlying servlet for the page.
Overrides:
getPage in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the Page implementation class instance (Servlet) associated with this PageContext

getRequest

public ServletRequest getRequest()
Returns the servlet request for the page.
Overrides:
getRequest in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
The ServletRequest for this PageContext

getResponse

public ServletResponse getResponse()
Returns the servlet response for the page.
Overrides:
getResponse in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the ServletResponse for this PageContext

getSession

public HttpSession getSession()
Description copied from class: PageContext
The current value of the session object (an HttpSession).
Overrides:
getSession in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the HttpSession for this PageContext or null

getServletConfig

public ServletConfig getServletConfig()
Description copied from class: PageContext
The ServletConfig instance.
Overrides:
getServletConfig in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the ServletConfig for this PageContext

getServletContext

public ServletContext getServletContext()
Returns the page's servlet context.
Overrides:
getServletContext in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
the ServletContext for this PageContext

getErrorPage

public java.lang.String getErrorPage()
Returns the page's error page.

setErrorPage

public void setErrorPage(java.lang.String errorPage)
Sets the page's error page.

getException

public java.lang.Exception getException()
Description copied from class: PageContext
The current value of the exception object (an Exception).
Overrides:
getException in class PageContext
Following copied from class: javax.servlet.jsp.PageContext
Returns:
any exception passed to this as an errorpage

getThrowable

public java.lang.Throwable getThrowable()
Returns the Throwable stored by the error page.

include

public void include(java.lang.String relativeUrl)
             throws ServletException,
                    java.io.IOException
Include another servlet into the current output stream.
Overrides:
include in class PageContext
Parameters:
relativeUrl - url relative to the current request.

forward

public void forward(java.lang.String relativeUrl)
             throws ServletException,
                    java.io.IOException
Forward a subrequest relative to the current url. Absolute URLs are relative to the context root.
Overrides:
forward in class PageContext
Parameters:
relativeUrl - url relative to the current file

handlePageException

public void handlePageException(java.lang.Exception e)
                         throws ServletException,
                                java.io.IOException
Handles an exception caught in the JSP page.
Overrides:
handlePageException in class PageContext
Parameters:
e - the caught exception

handlePageException

public void handlePageException(java.lang.Throwable e)
                         throws ServletException,
                                java.io.IOException
Handles an exception caught in the JSP page.
Overrides:
handlePageException in class PageContext
Parameters:
e - the caught exception

release

public void release()
Description copied from class: PageContext

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(). This method is typically called from JspFactory.releasePageContext().

Subclasses shall envelope this method.

This method should not be used by page or tag library authors.

Overrides:
release in class PageContext