org.chwf.taglib.jutil
Class IfTag
java.lang.Object
|
+--javax.servlet.jsp.tagext.TagSupport
|
+--org.chwf.taglib.base.LifeCycleTagSupport
|
+--org.chwf.taglib.base.ObjectTagSupport
|
+--org.chwf.taglib.jutil.IfTag
- All Implemented Interfaces:
- Parameterized, java.io.Serializable, javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
- ElseIfTag, ElseTag
- public class IfTag
- extends ObjectTagSupport
Tag handler for the <if>
tag.
- Author:
- Paul Strack
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
LAST_IF_RESULT
Constant storing the last test result. |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary |
IfTag()
|
Method Summary |
void |
cleanup()
Clean up data for tag handler reuse and pooling. |
int |
doEnd()
Initialize LAST_IF_RESULT. |
int |
doStart()
Evaluates test property and conditionally executes body. |
boolean |
getTestResult()
Get results of test. |
void |
setEl(java.lang.String el)
Calls superclass method. |
void |
setObject(java.lang.String objectName)
Calls superclass method. |
void |
setProperty(java.lang.String property)
Calls superclass method. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LAST_IF_RESULT
public static final java.lang.String LAST_IF_RESULT
- Constant storing the last test result.
IfTag
public IfTag()
setObject
public void setObject(java.lang.String objectName)
throws javax.servlet.jsp.JspException
- Calls superclass method. Is present here because of a bug in some servlet
engines that requires tag attibute setters to be defined in the tag class
itself.
- Overrides:
setObject
in class ObjectTagSupport
- Parameters:
objectName
- The object name.- Throws:
javax.servlet.jsp.JspException
- For errors.
setProperty
public void setProperty(java.lang.String property)
throws javax.servlet.jsp.JspException
- Calls superclass method. Is present here because of a bug in some servlet
engines that requires tag attibute setters to be defined in the tag class
itself.
- Overrides:
setProperty
in class ObjectTagSupport
- Parameters:
property
- The property name.- Throws:
javax.servlet.jsp.JspException
- For errors.
setEl
public void setEl(java.lang.String el)
- Calls superclass method. Is present here because of a bug in some servlet
engines that requires tag attibute setters to be defined in the tag class
itself.
- Overrides:
setEl
in class ObjectTagSupport
- Parameters:
el
- The JSTL Expression Language statement.
cleanup
public void cleanup()
- Clean up data for tag handler reuse and pooling. Should be overridden in
tag handler. Subclasses should always invoke their superclass's cleanup
method:
super.cleanup()
- Overrides:
cleanup
in class ObjectTagSupport
doStart
public int doStart()
throws javax.servlet.jsp.JspException
- Evaluates test property and conditionally executes body.
- Overrides:
doStart
in class LifeCycleTagSupport
- Returns:
- EVAL_BODY_INCLUDE If the test is true
- Throws:
javax.servlet.jsp.JspException
- If an exception is thrown during testing.
doEnd
public int doEnd()
throws javax.servlet.jsp.JspException
- Initialize LAST_IF_RESULT.
- Overrides:
doEnd
in class LifeCycleTagSupport
- Returns:
- EVAL_PAGE
- Throws:
javax.servlet.jsp.JspException
- For expression language parse errors.
getTestResult
public boolean getTestResult()
throws javax.servlet.jsp.JspException
- Get results of test.
- Returns:
- true if object property evaluates to true.
- Throws:
javax.servlet.jsp.JspException
- For expression language parse errors.
Copyright © 2002-2004, Paul Strack. All Rights Reserved.