public class PageContextImpl extends PageContext implements ExprEnv, JstlPageContext, VariableResolver
| Modifier and Type | Class and Description |
|---|---|
class |
PageContextImpl.PageELContext |
class |
PageContextImpl.PageFunctionMapper |
class |
PageContextImpl.PageVarEnv
Represents the XPath environment for this page.
|
class |
PageContextImpl.PageVariableMapper |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_isFilled |
APPLICATION, APPLICATION_SCOPE, CONFIG, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, REQUEST, REQUEST_SCOPE, RESPONSE, SESSION, SESSION_SCOPE| Constructor and Description |
|---|
PageContextImpl(WebApp webApp,
java.util.HashMap<java.lang.String,java.lang.reflect.Method> functionMap) |
PageContextImpl(WebApp webApp,
Servlet servlet) |
| Modifier and Type | Method and Description |
|---|---|
void |
applicationSetOrRemove(java.lang.String var,
java.lang.Object value)
Set/Remove an webApp attribute.
|
protected void |
clearAttributes() |
ValueExpression |
createExpr(ValueExpression expr,
java.lang.String exprString,
java.lang.Class type)
Creates an expression.
|
void |
defaultSetOrRemove(java.lang.String var,
java.lang.Object value)
Set/Remove a page attribute.
|
java.lang.StringBuilder |
encode(java.lang.String relativeUrl) |
java.lang.StringBuilder |
encode(java.lang.StringBuilder sb,
java.lang.String query) |
protected void |
fillAttribute()
Fills the predefined page content _attributes with their values.
|
java.lang.Object |
findAttribute(java.lang.String name)
Finds an attribute in any of the scopes from page to webApp.
|
void |
forward(java.lang.String relativeUrl)
Forward a subrequest relative to the current url.
|
void |
forward(java.lang.String relativeUrl,
java.lang.String query)
Include another servlet into the current output stream.
|
WebApp |
getApplication()
Returns the page's webApp.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the page attribute with the given name.
|
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
Gets an attribute in a given scope.
|
java.util.Enumeration<java.lang.String> |
getAttributeNames(int scope) |
java.util.Enumeration<java.lang.String> |
getAttributeNamesInScope(int scope)
Lists attribute names in a given scope.
|
int |
getAttributesScope(java.lang.String name)
Return the scope of the named attribute.
|
LocalizationContext |
getBundle(java.lang.String name)
Returns the localized message appropriate for the current context.
|
HttpServletRequest |
getCauchoRequest()
Returns the servlet response for the page.
|
CauchoResponse |
getCauchoResponse()
Returns the servlet response for the page.
|
ELContext |
getELContext()
Returns the expression evaluator
|
ErrorData |
getErrorData()
Returns the error data
|
java.lang.String |
getErrorPage()
Returns the page's error page.
|
java.lang.Exception |
getException()
Returns the exception for error pages.
|
ExpressionEvaluator |
getExpressionEvaluator()
Returns the expression evaluator
|
java.util.Locale |
getLocale()
Returns the currently active locale.
|
static java.util.Locale |
getLocale(java.lang.String value,
java.lang.String variant) |
java.lang.String |
getLocalizedMessage(java.lang.Object lc,
java.lang.String key,
java.lang.Object[] args,
java.lang.String basename)
Returns the localized message appropriate for the current context.
|
java.lang.String |
getLocalizedMessage(java.lang.String key,
java.lang.Object[] args,
java.lang.String basename)
Returns the localized message appropriate for the current context.
|
org.w3c.dom.Node |
getNodeEnv()
Returns the XPath node environment corresponding to this page
|
JspWriter |
getOut()
Returns the current writer.
|
java.lang.Object |
getPage()
Returns the underlying servlet for the page.
|
HttpServletRequest |
getRequest()
Returns the servlet request for the page.
|
HttpServletResponse |
getResponse()
Returns the servlet response for the page.
|
ServletConfig |
getServletConfig()
Returns the servletConfig for the JSP page.
|
ServletContext |
getServletContext()
Returns the page's servlet context.
|
HttpSession |
getSession()
Returns the request's session.
|
HttpSession |
getSessionScope()
Returns the session, throwing an IllegalStateException if it's
not available.
|
java.lang.Throwable |
getThrowable()
Returns the Throwable stored by the error page.
|
java.io.PrintWriter |
getTopWriter()
Returns the top writer.
|
VarEnv |
getVarEnv()
Returns the XPath variable environment corresponding to this page
|
VariableResolver |
getVariableResolver()
Returns the variable resolver
|
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)
Includes the a page relative to the current URL.
|
void |
include(java.lang.String relativeUrl,
boolean flush)
Include another servlet into the current output stream.
|
void |
include(java.lang.String relativeUrl,
java.lang.String query,
boolean flush)
Include another servlet into the current output stream.
|
protected void |
init() |
void |
initialize(Servlet servlet,
ServletRequest request,
ServletResponse response,
java.lang.String errorPage,
boolean needsSession,
int bufferSize,
boolean autoFlush)
Internal routine to initialize the PageContext for a page.
|
void |
initialize(Servlet servlet,
WebApp app,
ServletRequest request,
ServletResponse response,
java.lang.String errorPage,
HttpSession session,
int bufferSize,
boolean autoFlush,
boolean isPrintNullAsBlank) |
java.lang.String |
invoke(JspFragment fragment)
Evaluates the fragment, returing the string value.
|
java.io.Reader |
invokeReader(JspFragment fragment)
Evaluates the fragment, returing a reader
|
java.lang.String |
invokeTrim(JspFragment fragment)
Evaluates the fragment, returing the string value.
|
boolean |
isIgnoreException()
Returns true if the EL ignores exceptions
|
void |
pageSetOrRemove(java.lang.String var,
java.lang.Object value)
Set/Remove a page attribute.
|
JspWriter |
popAndReleaseBody()
Pops the BodyContent from the JspWriter stack.
|
JspWriter |
popBody()
Pops the BodyContent from the JspWriter stack.
|
static void |
printBody(BodyContentImpl body,
boolean isEscaped) |
BodyContent |
pushBody()
Pushes a new BodyContent onto the JspWriter stack.
|
JspWriter |
pushBody(java.io.Writer writer)
Pushes a new writer onto the JspWriter stack.
|
java.lang.Object |
putAttribute(java.lang.String name,
java.lang.Object attribute)
Sets the page attribute with the given name.
|
void |
release()
Releases the context.
|
void |
releaseBody(BodyContentImpl out) |
void |
removeAttribute(java.lang.String name)
Removes a named attribute from the page context.
|
void |
removeAttribute(java.lang.String name,
int scope)
Removes an attribute in a given scope.
|
void |
requestSetOrRemove(java.lang.String var,
java.lang.Object value)
Set/Remove a request attribute.
|
java.lang.Object |
resolveVariable(java.lang.String name)
Finds an attribute in any of the scopes from page to webApp.
|
void |
sessionSetOrRemove(java.lang.String var,
java.lang.Object value)
Set/Remove a session attribute.
|
void |
setAttribute(java.lang.String name,
java.lang.Object attribute)
Sets the page attribute with the given name.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
Sets an attribute in a given scope.
|
void |
setErrorPage(java.lang.String errorPage)
Sets the page's error page.
|
java.util.Map<java.lang.String,java.lang.Object> |
setMap(java.util.Map<java.lang.String,java.lang.Object> map)
Sets the attribute map.
|
void |
setNodeEnv(org.w3c.dom.Node node)
Returns the XPath node environment corresponding to this page
|
protected void |
setOut(JspWriter out) |
JspWriter |
setWriter(JspWriter oldWriter)
Pops the BodyContent from the JspWriter stack.
|
static boolean |
toBoolean(java.lang.String value)
Parses a boolean value.
|
public PageContextImpl(WebApp webApp, java.util.HashMap<java.lang.String,java.lang.reflect.Method> functionMap)
public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, java.lang.String errorPage, boolean needsSession, int bufferSize, boolean autoFlush)
PageContextinitialize in class PageContextpublic void initialize(Servlet servlet, WebApp app, ServletRequest request, ServletResponse response, java.lang.String errorPage, HttpSession session, int bufferSize, boolean autoFlush, boolean isPrintNullAsBlank)
protected void init()
protected void setOut(JspWriter out)
protected void clearAttributes()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in class PageContextname - the attribute name.public void setAttribute(java.lang.String name,
java.lang.Object attribute)
setAttribute in class PageContextname - the attribute name.attribute - the new valuepublic java.lang.Object putAttribute(java.lang.String name,
java.lang.Object attribute)
name - the attribute name.attribute - the new valuepublic void removeAttribute(java.lang.String name)
removeAttribute in class PageContextname - the name of the attribute to removeprotected void fillAttribute()
public java.lang.Object getAttribute(java.lang.String name,
int scope)
JspContextgetAttribute in class JspContextname - attribute namescope - attribute scopepublic void setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
JspContextsetAttribute in class JspContextname - attribute namevalue - attribute valuescope - attribute scopepublic void removeAttribute(java.lang.String name,
int scope)
JspContextremoveAttribute in class JspContextpublic java.util.Enumeration<java.lang.String> getAttributeNames(int scope)
public java.util.Enumeration<java.lang.String> getAttributeNamesInScope(int scope)
JspContextgetAttributeNamesInScope in class JspContextpublic java.lang.Object findAttribute(java.lang.String name)
findAttribute in class JspContextname - the attribute name.public int getAttributesScope(java.lang.String name)
getAttributesScope in class JspContextname - the name of the attribute.public java.util.Map<java.lang.String,java.lang.Object> setMap(java.util.Map<java.lang.String,java.lang.Object> map)
public JspWriter getOut()
getOut in class PageContextpublic BodyContent pushBody()
pushBody in class PageContextpublic JspWriter pushBody(java.io.Writer writer)
pushBody in class JspContextpublic JspWriter popBody()
popBody in class JspContextpublic JspWriter popAndReleaseBody() throws java.io.IOException
java.io.IOExceptionpublic void releaseBody(BodyContentImpl out) throws java.io.IOException
java.io.IOExceptionpublic JspWriter setWriter(JspWriter oldWriter)
oldWriter - the old writerpublic java.io.PrintWriter getTopWriter()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object getPage()
getPage in class PageContextpublic HttpServletRequest getRequest()
getRequest in class PageContextpublic HttpServletResponse getResponse()
getResponse in class PageContextpublic CauchoResponse getCauchoResponse()
public HttpServletRequest getCauchoRequest()
public HttpSession getSession()
PageContextgetSession in class PageContextpublic HttpSession getSessionScope()
public ServletConfig getServletConfig()
PageContextgetServletConfig in class PageContextpublic ServletContext getServletContext()
getServletContext in class PageContextpublic WebApp getApplication()
public java.lang.String getErrorPage()
public void setErrorPage(java.lang.String errorPage)
public java.lang.Exception getException()
PageContextgetException in class PageContextpublic java.lang.Throwable getThrowable()
public void include(java.lang.String relativeUrl)
throws ServletException,
java.io.IOException
PageContextinclude in class PageContextServletExceptionjava.io.IOExceptionpublic void include(java.lang.String relativeUrl,
java.lang.String query,
boolean flush)
throws ServletException,
java.io.IOException
relativeUrl - url relative to the current request.ServletExceptionjava.io.IOExceptionpublic java.lang.StringBuilder encode(java.lang.String relativeUrl)
public java.lang.StringBuilder encode(java.lang.StringBuilder sb,
java.lang.String query)
public void include(java.lang.String relativeUrl,
boolean flush)
throws ServletException,
java.io.IOException
include in class PageContextrelativeUrl - url relative to the current request.ServletExceptionjava.io.IOExceptionpublic void forward(java.lang.String relativeUrl,
java.lang.String query)
throws ServletException,
java.io.IOException
relativeUrl - url relative to the current request.ServletExceptionjava.io.IOExceptionpublic void forward(java.lang.String relativeUrl)
throws ServletException,
java.io.IOException
forward in class PageContextrelativeUrl - url relative to the current fileServletExceptionjava.io.IOExceptionpublic void handlePageException(java.lang.Exception e)
throws ServletException,
java.io.IOException
handlePageException in class PageContexte - the caught exceptionServletExceptionjava.io.IOExceptionpublic void handlePageException(java.lang.Throwable e)
throws ServletException,
java.io.IOException
handlePageException in class PageContexte - the caught exceptionServletExceptionjava.io.IOExceptionpublic ErrorData getErrorData()
getErrorData in class PageContextpublic VariableResolver getVariableResolver()
getVariableResolver in class JspContextpublic ExpressionEvaluator getExpressionEvaluator()
getExpressionEvaluator in class JspContextpublic ELContext getELContext()
getELContext in class JspContextpublic void release()
release in class PageContextpublic java.lang.String getLocalizedMessage(java.lang.String key,
java.lang.Object[] args,
java.lang.String basename)
getLocalizedMessage in interface JstlPageContextpublic java.lang.String getLocalizedMessage(java.lang.Object lc,
java.lang.String key,
java.lang.Object[] args,
java.lang.String basename)
getLocalizedMessage in interface JstlPageContextpublic LocalizationContext getBundle(java.lang.String name)
public java.util.Locale getLocale()
public static java.util.Locale getLocale(java.lang.String value,
java.lang.String variant)
public static void printBody(BodyContentImpl body, boolean isEscaped) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String invoke(JspFragment fragment) throws JspException, java.io.IOException
JspExceptionjava.io.IOExceptionpublic java.lang.String invokeTrim(JspFragment fragment) throws JspException, java.io.IOException
JspExceptionjava.io.IOExceptionpublic java.io.Reader invokeReader(JspFragment fragment) throws JspException, java.io.IOException
JspExceptionjava.io.IOExceptionpublic static boolean toBoolean(java.lang.String value)
public void defaultSetOrRemove(java.lang.String var,
java.lang.Object value)
public void pageSetOrRemove(java.lang.String var,
java.lang.Object value)
public void requestSetOrRemove(java.lang.String var,
java.lang.Object value)
public void sessionSetOrRemove(java.lang.String var,
java.lang.Object value)
public void applicationSetOrRemove(java.lang.String var,
java.lang.Object value)
public boolean isIgnoreException()
isIgnoreException in interface ExprEnvpublic VarEnv getVarEnv()
public org.w3c.dom.Node getNodeEnv()
public void setNodeEnv(org.w3c.dom.Node node)
public ValueExpression createExpr(ValueExpression expr, java.lang.String exprString, java.lang.Class type)
public java.lang.Object resolveVariable(java.lang.String name)
throws ELException
resolveVariable in interface VariableResolvername - the attribute name.ELException