public abstract class RequestContextAwareTag extends TagSupport implements TryCatchFinally
RequestContext
.
The RequestContext
instance provides easy access
to current state like the
WebApplicationContext
,
the Locale
, the
Theme
, etc.
Mainly intended for
DispatcherServlet
requests;
will use fallbacks when used outside DispatcherServlet
.
RequestContext
,
DispatcherServlet
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Log |
logger
Logger available to subclasses
|
static String |
REQUEST_CONTEXT_PAGE_ATTRIBUTE
PageContext attribute for the
page-level RequestContext instance. |
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
RequestContextAwareTag() |
Modifier and Type | Method and Description |
---|---|
void |
doCatch(Throwable throwable) |
void |
doFinally() |
int |
doStartTag()
Create and expose the current RequestContext.
|
protected abstract int |
doStartTagInternal()
Called by doStartTag to perform the actual work.
|
protected RequestContext |
getRequestContext()
Return the current RequestContext.
|
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
public static final String REQUEST_CONTEXT_PAGE_ATTRIBUTE
PageContext
attribute for the
page-level RequestContext
instance.protected final Log logger
public final int doStartTag() throws JspException
doStartTagInternal()
for actual work.doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
REQUEST_CONTEXT_PAGE_ATTRIBUTE
,
JspAwareRequestContext
protected final RequestContext getRequestContext()
protected abstract int doStartTagInternal() throws Exception
Exception
- any exception, any checked one other than
a JspException gets wrapped in a JspException by doStartTagTagSupport.doStartTag()
public void doCatch(Throwable throwable) throws Throwable
doCatch
in interface TryCatchFinally
Throwable
public void doFinally()
doFinally
in interface TryCatchFinally