org.apache.struts2.components

## Class Else

- java.lang.Object
- - org.apache.struts2.components.Component
  - - org.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>

- - ### Field Summary

    - ### Fields inherited from class org.apache.struts2.components.Component

      `actionMapper, COMPONENT_STACK, devMode, escapeHtmlBody, parameters, performClearTagStateForTagPoolingServers, stack, standardAttributesMap, throwExceptionOnELFailure`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Else(ValueStack stack)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `start(Writer writer)` Callback for the start tag of this component.

    - ### Methods inherited from class org.apache.struts2.components.Component

      `addAllParameters, addParameter, clearStandardAttributesMap, completeExpression, copyParams, determineActionURL, determineNamespace, end, end, escapeHtmlBody, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getAttributes, getComponentStack, getNamespace, getParameters, getPerformClearTagStateForTagPoolingServers, getStack, getStandardAttributes, isAcceptableExpression, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setEscapeHtmlBody, setNotExcludedAcceptedPatterns, setPerformClearTagStateForTagPoolingServers, setThrowExceptionsOnELFailure, setUrlHelper, stripExpression, toString, usesBody`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Else

          public Else(ValueStack stack)

  - ### Method Detail

    - #### start

          public boolean start(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

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.