org.apache.struts2.components
类 If
java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.If
public class If
- 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>
- 另请参见:
Else
,
ElseIf
构造方法摘要 |
If(com.opensymphony.xwork2.util.ValueStack stack)
|
从类 org.apache.struts2.components.Component 继承的方法 |
addAllParameters, addParameter, altSyntax, copyParams, getComponentStack, getParameters, getStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, usesBody |
ANSWER
public static final String ANSWER
- 另请参见:
- 常量字段值
If
public If(com.opensymphony.xwork2.util.ValueStack stack)
setTest
public void setTest(String test)
start
public boolean start(Writer writer)
- 从类
Component
复制的描述
- Callback for the start tag of this component.
Should the body be evaluated?
- 覆盖:
- 类
Component
中的 start
- 参数:
writer
- the output writer.
- 返回:
- true if the body should be evaluated
end
public boolean end(Writer writer,
String body)
- 从类
Component
复制的描述
- Callback for the end tag of this component.
Should the body be evaluated again?
NOTE: will pop component stack.
- 覆盖:
- 类
Component
中的 end
- 参数:
writer
- the output writer.body
- the rendered body.
- 返回:
- true if the body should be evaluated again