org.apache.struts2.components
Class ElseIf
java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.ElseIf
public class ElseIf
- extends Component
Perform basic condition flow. 'If' tag could be used by itself or with 'Else If' Tag and/or single/multiple 'Else'
Tag.
- test* (Boolean) - Logic to determined if body of tag is to be displayed
<s:if test="%{false}">
<div>Will Not Be Executed</div>
</s:if>
<s:elseif test="%{true}">
<div>Will Be Executed</div>
</s:elseif>
<s:else>
<div>Will Not Be Executed</div>
</s:else>
Field Summary |
protected java.lang.Boolean |
answer
|
protected java.lang.String |
test
|
Method Summary |
boolean |
end(java.io.Writer writer,
java.lang.String body)
Callback for the end tag of this component. |
void |
setTest(java.lang.String test)
|
boolean |
start(java.io.Writer writer)
Callback for the start tag of this component. |
Methods inherited from class org.apache.struts2.components.Component |
addAllParameters, addParameter, altSyntax, altSyntax, completeExpressionIfAltSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, popComponentStack, setActionMapper, setThrowExceptionsOnELFailure, stripExpressionIfAltSyntax, stripExpressionIfAltSyntax, toString, usesBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
answer
protected java.lang.Boolean answer
test
protected java.lang.String test
ElseIf
public ElseIf(ValueStack stack)
start
public boolean start(java.io.Writer writer)
- Description copied from class:
Component
- Callback for the start tag of this component.
Should the body be evaluated?
- Overrides:
start
in class Component
- Parameters:
writer
- the output writer.
- Returns:
- true if the body should be evaluated
end
public boolean end(java.io.Writer writer,
java.lang.String body)
- Description copied from class:
Component
- Callback for the end tag of this component.
Should the body be evaluated again?
NOTE: will pop component stack.
- Overrides:
end
in class Component
- Parameters:
writer
- the output writer.body
- the rendered body.
- Returns:
- true if the body should be evaluated again
setTest
public void setTest(java.lang.String test)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.