org.apache.jasper.runtime

Class PageContextImpl

Implemented Interfaces:
VariableResolver

public class PageContextImpl
extends PageContext
implements VariableResolver

Implementation of the PageContext class from the JSP spec. Also doubles as a VariableResolver for the EL.
Authors:
Anil K. Vijendran
Larry Cable
Hans Bergsten
Pierre Delisle
Mark Roth
Jan Luehe

Method Summary

Object
findAttribute(String name)
void
forward(String relativeUrlPath)
Object
getAttribute(String name)
Object
getAttribute(String name, int scope)
Enumeration
getAttributeNamesInScope(int scope)
int
getAttributesScope(String name)
Exception
getException()
Returns the exception associated with this page context, if any.
ExpressionEvaluator
getExpressionEvaluator()
Provides programmatic access to the ExpressionEvaluator.
JspWriter
getOut()
Object
getPage()
ServletRequest
getRequest()
ServletResponse
getResponse()
Servlet
getServlet()
ServletConfig
getServletConfig()
ServletContext
getServletContext()
HttpSession
getSession()
VariableResolver
getVariableResolver()
void
handlePageException(Exception ex)
void
handlePageException(Throwable t)
void
include(String relativeUrlPath)
void
include(String relativeUrlPath, boolean flush)
void
initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
JspWriter
popBody()
static Object
proprietaryEvaluate(String expression, Class expectedType, PageContext pageContext, ProtectedFunctionMapper functionMap, boolean escape)
Proprietary method to evaluate EL expressions.
BodyContent
pushBody()
JspWriter
pushBody(Writer writer)
void
release()
void
removeAttribute(String name)
void
removeAttribute(String name, int scope)
Object
resolveVariable(String pName)
VariableResolver interface
void
setAttribute(String name, Object attribute)
void
setAttribute(String name, Object o, int scope)

Method Details

findAttribute

public Object findAttribute(String name)

forward

public void forward(String relativeUrlPath)
            throws ServletException,
                   IOException

getAttribute

public Object getAttribute(String name)

getAttribute

public Object getAttribute(String name,
                           int scope)

getAttributeNamesInScope

public Enumeration getAttributeNamesInScope(int scope)

getAttributesScope

public int getAttributesScope(String name)

getException

public Exception getException()
Returns the exception associated with this page context, if any.

Added wrapping for Throwables to avoid ClassCastException: see Bugzilla 31171 for details.

Returns:
The Exception associated with this page context, if any.

getExpressionEvaluator

public ExpressionEvaluator getExpressionEvaluator()
Provides programmatic access to the ExpressionEvaluator. The JSP Container must return a valid instance of an ExpressionEvaluator that can parse EL expressions.

getOut

public JspWriter getOut()

getPage

public Object getPage()

getRequest

public ServletRequest getRequest()

getResponse

public ServletResponse getResponse()

getServlet

public Servlet getServlet()

getServletConfig

public ServletConfig getServletConfig()

getServletContext

public ServletContext getServletContext()

getSession

public HttpSession getSession()

getVariableResolver

public VariableResolver getVariableResolver()

handlePageException

public void handlePageException(Exception ex)
            throws IOException,
                   ServletException

handlePageException

public void handlePageException(Throwable t)
            throws IOException,
                   ServletException

include

public void include(String relativeUrlPath)
            throws ServletException,
                   IOException

include

public void include(String relativeUrlPath,
                    boolean flush)
            throws ServletException,
                   IOException

initialize

public void initialize(Servlet servlet,
                       ServletRequest request,
                       ServletResponse response,
                       String errorPageURL,
                       boolean needsSession,
                       int bufferSize,
                       boolean autoFlush)
            throws IOException

popBody

public JspWriter popBody()

proprietaryEvaluate

public static Object proprietaryEvaluate(String expression,
                                         Class expectedType,
                                         PageContext pageContext,
                                         ProtectedFunctionMapper functionMap,
                                         boolean escape)
            throws ELException
Proprietary method to evaluate EL expressions. XXX - This method should go away once the EL interpreter moves out of JSTL and into its own project. For now, this is necessary because the standard machinery is too slow.
Parameters:
expression - The expression to be evaluated
expectedType - The expected resulting type
pageContext - The page context
functionMap - Maps prefix and name to Method
Returns:
The result of the evaluation

pushBody

public BodyContent pushBody()

pushBody

public JspWriter pushBody(Writer writer)

release

public void release()

removeAttribute

public void removeAttribute(String name)

removeAttribute

public void removeAttribute(String name,
                            int scope)

resolveVariable

public Object resolveVariable(String pName)
            throws ELException
VariableResolver interface

setAttribute

public void setAttribute(String name,
                         Object attribute)

setAttribute

public void setAttribute(String name,
                         Object o,
                         int scope)

Copyright ?? 2000-2004 Apache Software Foundation. All Rights Reserved.