Package javax.servlet.jsp.jstl.core
Class ConditionalTagSupport
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.jstl.core.ConditionalTagSupport
- All Implemented Interfaces:
Serializable,IterationTag,JspTag,Tag
- Direct Known Subclasses:
IfTag,WhenTagSupport
Abstract class that facilitates implementation of conditional actions where the boolean result is exposed as a JSP scoped variable. The boolean result may then be used as the test condition in a <c:when> action.
This base class provides support for:
- Conditional processing of the action's body based on the returned value of the abstract method condition().
- Storing the result of condition() as a Boolean object into a JSP scoped variable identified by attributes var and scope.
- See Also:
-
Field Summary
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
Constructor Details
-
ConditionalTagSupport
public ConditionalTagSupport()Base constructor to initialize local state. As with TagSupport, subclasses should not implement constructors with arguments, and no-argument constructors implemented by subclasses must call the superclass constructor.
-
-
Method Details
-
doStartTag
Includes its body if condition() evaluates to true.- Specified by:
doStartTagin interfaceTag- Overrides:
doStartTagin classTagSupport- Returns:
- SKIP_BODY
- Throws:
JspException- if an error occurs while processing this tag- See Also:
-
release
public void release()Releases any resources this ConditionalTagSupport may have (or inherit).- Specified by:
releasein interfaceTag- Overrides:
releasein classTagSupport- See Also:
-
setVar
Sets the 'var' attribute.- Parameters:
var- Name of the exported scoped variable storing the result of condition().
-
setScope
Sets the 'scope' attribute.- Parameters:
scope- Scope of the 'var' attribute
-