FileDocCategorySizeDatePackage
Else.javaAPI DocExample2290Mon Jul 23 13:26:36 BST 2007org.apache.struts2.components

Else

public class Else extends Component

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

no params

<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>

Fields Summary
Constructors Summary
public Else(com.opensymphony.xwork2.util.ValueStack stack)

        super(stack);
    
Methods Summary
public booleanstart(java.io.Writer writer)

        Map context = stack.getContext();
        Boolean ifResult = (Boolean) context.get(If.ANSWER);

        context.remove(If.ANSWER);

        return !((ifResult == null) || (ifResult.booleanValue()));