Class RequestContextAwareTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.springframework.web.servlet.tags.RequestContextAwareTag
- All Implemented Interfaces:
IterationTag
,JspTag
,Tag
,TryCatchFinally
,Serializable
- Direct Known Subclasses:
HtmlEscapeTag
,HtmlEscapingAwareTag
Superclass for all tags that require a
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
.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Log
Logger available to subclasses.static final String
PageContext
attribute for the page-levelRequestContext
instance.Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
final int
Create and expose the current RequestContext.protected abstract int
Called by doStartTag to perform the actual work.protected final RequestContext
Return the current RequestContext.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
-
Field Details
-
REQUEST_CONTEXT_PAGE_ATTRIBUTE
PageContext
attribute for the page-levelRequestContext
instance.- See Also:
-
logger
Logger available to subclasses.
-
-
Constructor Details
-
RequestContextAwareTag
public RequestContextAwareTag()
-
-
Method Details
-
doStartTag
Create and expose the current RequestContext. Delegates todoStartTagInternal()
for actual work.- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Throws:
JspException
- See Also:
-
getRequestContext
Return the current RequestContext. -
doStartTagInternal
Called by doStartTag to perform the actual work.- Returns:
- same as TagSupport.doStartTag
- Throws:
Exception
- any exception, any checked one other than a JspException gets wrapped in a JspException by doStartTag- See Also:
-
doCatch
- Specified by:
doCatch
in interfaceTryCatchFinally
- Throws:
Throwable
-
doFinally
public void doFinally()- Specified by:
doFinally
in interfaceTryCatchFinally
-