Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
titleMultiple Results
<action name="Hello">
    <result>/hello/Result.jsp</result>
    <result name="error">/hello/Error.jsp</result>
    <result name="input">/hello/Input.jsp</result>
</action>

A special 'other' result can be configured by adding a result with name="*". This result will only be selected if no result is found with a matching name.

Code Block
xml
xml
title'*' Other Result

<action name="Hello">
    <result>/hello/Result.jsp</result>
    <result name="error">/hello/Error.jsp</result>
    <result name="input">/hello/Input.jsp</result>
    <result name="*">/hello/Other.jsp</result>
</action>

(info) The name="*" is not a wildcard pattern, it is a special name that is only selected if an exact match is not found.

(warning) In most cases if an action returns an unrecognized result name this would be a programming error and should be fixed.

Global Results

Most often, results are nested with the action element. But some results apply to multiple actions. In a secure application, a client might try to access a page without being authorized, and many actions may need access to a "logon" result.

...