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 |
---|
xmlformat | xml | title | struts.xml |
---|
borderStyle | solid |
---|
|
<action name="Logon" class="tutorial.Logon">
<result name="input">/tutorial/Logon.jsp</result>
<result type="redirect-action">HelloWorld</result>
</action>
|
...
Code Block |
---|
|
<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>
|
...