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)
PageContext
initialize
in class PageContext
public 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 PageContext
name
- the attribute name.public void setAttribute(java.lang.String name, java.lang.Object attribute)
setAttribute
in class PageContext
name
- 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 PageContext
name
- the name of the attribute to removeprotected void fillAttribute()
public java.lang.Object getAttribute(java.lang.String name, int scope)
JspContext
getAttribute
in class JspContext
name
- attribute namescope
- attribute scopepublic void setAttribute(java.lang.String name, java.lang.Object value, int scope)
JspContext
setAttribute
in class JspContext
name
- attribute namevalue
- attribute valuescope
- attribute scopepublic void removeAttribute(java.lang.String name, int scope)
JspContext
removeAttribute
in class JspContext
public java.util.Enumeration<java.lang.String> getAttributeNames(int scope)
public java.util.Enumeration<java.lang.String> getAttributeNamesInScope(int scope)
JspContext
getAttributeNamesInScope
in class JspContext
public java.lang.Object findAttribute(java.lang.String name)
findAttribute
in class JspContext
name
- the attribute name.public int getAttributesScope(java.lang.String name)
getAttributesScope
in class JspContext
name
- 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 PageContext
public BodyContent pushBody()
pushBody
in class PageContext
public JspWriter pushBody(java.io.Writer writer)
pushBody
in class JspContext
public JspWriter popBody()
popBody
in class JspContext
public JspWriter popAndReleaseBody() throws java.io.IOException
java.io.IOException
public void releaseBody(BodyContentImpl out) throws java.io.IOException
java.io.IOException
public JspWriter setWriter(JspWriter oldWriter)
oldWriter
- the old writerpublic java.io.PrintWriter getTopWriter() throws java.io.IOException
java.io.IOException
public java.lang.Object getPage()
getPage
in class PageContext
public HttpServletRequest getRequest()
getRequest
in class PageContext
public HttpServletResponse getResponse()
getResponse
in class PageContext
public CauchoResponse getCauchoResponse()
public HttpServletRequest getCauchoRequest()
public HttpSession getSession()
PageContext
getSession
in class PageContext
public HttpSession getSessionScope()
public ServletConfig getServletConfig()
PageContext
getServletConfig
in class PageContext
public ServletContext getServletContext()
getServletContext
in class PageContext
public WebApp getApplication()
public java.lang.String getErrorPage()
public void setErrorPage(java.lang.String errorPage)
public java.lang.Exception getException()
PageContext
getException
in class PageContext
public java.lang.Throwable getThrowable()
public void include(java.lang.String relativeUrl) throws ServletException, java.io.IOException
PageContext
include
in class PageContext
ServletException
java.io.IOException
public void include(java.lang.String relativeUrl, java.lang.String query, boolean flush) throws ServletException, java.io.IOException
relativeUrl
- url relative to the current request.ServletException
java.io.IOException
public 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 PageContext
relativeUrl
- url relative to the current request.ServletException
java.io.IOException
public void forward(java.lang.String relativeUrl, java.lang.String query) throws ServletException, java.io.IOException
relativeUrl
- url relative to the current request.ServletException
java.io.IOException
public void forward(java.lang.String relativeUrl) throws ServletException, java.io.IOException
forward
in class PageContext
relativeUrl
- url relative to the current fileServletException
java.io.IOException
public void handlePageException(java.lang.Exception e) throws ServletException, java.io.IOException
handlePageException
in class PageContext
e
- the caught exceptionServletException
java.io.IOException
public void handlePageException(java.lang.Throwable e) throws ServletException, java.io.IOException
handlePageException
in class PageContext
e
- the caught exceptionServletException
java.io.IOException
public ErrorData getErrorData()
getErrorData
in class PageContext
public VariableResolver getVariableResolver()
getVariableResolver
in class JspContext
public ExpressionEvaluator getExpressionEvaluator()
getExpressionEvaluator
in class JspContext
public ELContext getELContext()
getELContext
in class JspContext
public void release()
release
in class PageContext
public java.lang.String getLocalizedMessage(java.lang.String key, java.lang.Object[] args, java.lang.String basename)
getLocalizedMessage
in interface JstlPageContext
public java.lang.String getLocalizedMessage(java.lang.Object lc, java.lang.String key, java.lang.Object[] args, java.lang.String basename)
getLocalizedMessage
in interface JstlPageContext
public 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.IOException
public java.lang.String invoke(JspFragment fragment) throws JspException, java.io.IOException
JspException
java.io.IOException
public java.lang.String invokeTrim(JspFragment fragment) throws JspException, java.io.IOException
JspException
java.io.IOException
public java.io.Reader invokeReader(JspFragment fragment) throws JspException, java.io.IOException
JspException
java.io.IOException
public 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 ExprEnv
public 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 VariableResolver
name
- the attribute name.ELException