com.taggercat.tags
Class TCIfThenElseTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
com.taggercat.tags.AbstractExpEvalTag
com.taggercat.tags.TCIfTag
com.taggercat.tags.TCIfThenElseTag
- All Implemented Interfaces:
- com.taggercat.el.ELPropertyResolver, java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class TCIfThenElseTag
- extends TCIfTag
This tag evaluates an expression and includes the body of the tag regardless
of expression evaluating to true or false. Unlike the TCIfTag, this
tag is used only as a parent to the TCThen and TCElse tags.
If a var and scope attribute are set, then the result is also added as an
attribute to that scope object. The scope variable is set even if the
expression evaluates to false.
Tag Attributes
- test the expression to be evaluated
- var (optional) the variable name
- scope (optional) the scope to place the results on
The scope can be one of:
page - default if not specified
session
request
application
Example:
<tc:ifThenElse test="100 GT 5" >
<tc:then>
<BR><B>Hello Then Contents!</B>
</tc:then >
<tc:else>
<BR><B>Hello Else Contents!</B>
</tc:else >
</tc:ifThenElse >
- See Also:
- Serialized Form
-

| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
|
Method Summary |
int |
doStartTag()
Process the start tag for this instance. |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TCIfThenElseTag
public TCIfThenElseTag()
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Process the start tag for this instance. The doStartTag() method assumes
that all setter methods have been invoked before. When this method is
invoked, the body has not yet been invoked.
- Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doStartTag in class TCIfTag
- Throws:
javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspException
- Returns:
- EVAL_BODY_INCLUDE if the tag wants to process body,
and SKIP_BODY if it does not want to process it.