org.apache.jasper.runtime

Class PageContextImpl

public class PageContextImpl extends PageContext

Implementation of the PageContext class from the JSP spec. Also doubles as a VariableResolver for the EL.

Author: Anil K. Vijendran Larry Cable Hans Bergsten Pierre Delisle Mark Roth Jan Luehe Jacob Hookom

Method Summary
ObjectfindAttribute(String name)
voidforward(String relativeUrlPath)
ObjectgetAttribute(String name)
ObjectgetAttribute(String name, int scope)
Enumeration<String>getAttributeNamesInScope(int scope)
intgetAttributesScope(String name)
ELContextgetELContext()
ExceptiongetException()
Returns the exception associated with this page context, if any.
ExpressionEvaluatorgetExpressionEvaluator()
Provides programmatic access to the ExpressionEvaluator.
JspWritergetOut()
ObjectgetPage()
ServletRequestgetRequest()
ServletResponsegetResponse()
ServletgetServlet()
ServletConfiggetServletConfig()
ServletContextgetServletContext()
HttpSessiongetSession()
VariableResolvergetVariableResolver()
voidhandlePageException(Exception ex)
voidhandlePageException(Throwable t)
voidinclude(String relativeUrlPath)
voidinclude(String relativeUrlPath, boolean flush)
voidinitialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
JspWriterpopBody()
static ObjectproprietaryEvaluate(String expression, Class expectedType, PageContext pageContext, ProtectedFunctionMapper functionMap, boolean escape)
Proprietary method to evaluate EL expressions.
BodyContentpushBody()
JspWriterpushBody(Writer writer)
voidrelease()
voidremoveAttribute(String name, int scope)
voidremoveAttribute(String name)
voidsetAttribute(String name, Object attribute)
voidsetAttribute(String name, Object o, int scope)

Method Detail

findAttribute

public Object findAttribute(String name)

forward

public void forward(String relativeUrlPath)

getAttribute

public Object getAttribute(String name)

getAttribute

public Object getAttribute(String name, int scope)

getAttributeNamesInScope

public Enumeration<String> getAttributeNamesInScope(int scope)

getAttributesScope

public int getAttributesScope(String name)

getELContext

public ELContext getELContext()

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)

handlePageException

public void handlePageException(Throwable t)

include

public void include(String relativeUrlPath)

include

public void include(String relativeUrlPath, boolean flush)

initialize

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

popBody

public JspWriter popBody()

proprietaryEvaluate

public static Object proprietaryEvaluate(String expression, Class expectedType, PageContext pageContext, ProtectedFunctionMapper functionMap, boolean escape)
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, int scope)

removeAttribute

public void removeAttribute(String name)

setAttribute

public void setAttribute(String name, Object attribute)

setAttribute

public void setAttribute(String name, Object o, int scope)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.