Versions Compared

Key

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

After the Action processes the request, a result is selected to provide the response. A result may simply forward to a HTML page, or a JavaServer page, a FreeMaker or Velocity template, or the result might construct a PDF or some other complex report. There may be multiple results available to an action mapping. To indicate which one to select, the Action class returns a name corresponding to the appropriate result.

Code Block
xml
formatxml
titlestruts.xml
borderStylesolid
<action name="Logon" class="tutorial.Logon">
  <result name="input">/tutorial/Logon.jsp</result>
  <result type="redirect-action">HelloWorld</result>
</action>

...

Code Block
xml
xml
titlestruts.xml
<package name="default" extends="struts-default">{code:title=struts.xml|format=xml|borderStyle=solid}
   <global-results>
      <result name="login" type="redirect-action">Login</result>
      <result name="unauthorized" type="action-chain">Unauthorized</result>
   </global-results>
   <!-- other package declarations -->
</package>

...