Versions Compared

Key

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

Update links

...

So far, our results have used the default type, Dispatcher. The Dispatcher forwards to another web resource. Other kinds of views can be used by specifying a different result type.

Configuring Result Types

The action-default package defines result types for the Results provided with the framework. If your package uses a custom result type, you can add it to your package.

...

Code Block
xml
xml
titleaction.xml
<xwork>
   <include name="action-default.xml"/>
   <package name="default" extends="action-default">

      <result-types>
        <result-type name="image" class="tutorial.ImageResult" />
      </result-types>

      <action name="image" class="tutorial.ImageAction">
        <result name="success" type="image"/>
     </action>
   </package>
</xwork>

Reducing Configuration Duplication with Global Result Mappings

It's not unusual for mappings to share Results. If your application is secured, then many mappings will need to return "login".

...

Note
titleBe Careful

Because global results are searched after local results, you can override any global result mapping by creating a local result mapping for a specific action. Recall that results can point to locations using relative or absolute paths. Because you may not know the context in which they're being invoked, it's best to use absolute paths for global results.

Next

Onward to Understanding Interceptors

Prev

Return to Understanding Actions