Apache Struts 2 Documentation > Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > Generic Tag Reference > elseIf
Added by digi9ten, last edited by Ted Husted on Sep 02, 2006  (view change)
Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.

Description

Content pulled from external source. Click here to refresh.

Perform basic condition flow. 'If' tag could be used by itself or with 'Else If' Tag and/or single/multiple 'Else' Tag.

Parameters

Content pulled from external source. Click here to refresh.

Name

Required

Default

Type

Description

test true   Boolean Expression to determine if body of tag is to be displayed
id false   Object/String id for referencing element. For UI and form tags it will be used as HTML id attribute

Examples

Content pulled from external source. Click here to refresh.
<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>