Apache Struts 2 Documentation > Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > Generic Tag Reference > if |
![]() | Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works. |
Perform basic condition flow. 'If' tag could be used by itself or with 'Else If' Tag and/or single/multiple 'Else' Tag. |
|
<s:if test="%{false}"> <div>Will Not Be Executed</div> </s:if> <s:elseif test="%{true}"> <div>Will Be Executed</div> <s:else> </s:elseif> <div>Will Not Be Executed</div> </s:else> |