...
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.
types.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<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> |
...
Another way to reduce the amount of configuration in the action.xml
is through the use of global result mappings. Web applications often have a common set of results that are used across many action mappings. Common results include redirects to login actions and permission-denied pages. Rather than define each of these results in every action mapping, the framework lets you centralize the definitions for the common pages.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<package name="default" extends="webwork-default"> <global-results> <result name="login" type="redirect">/login!default.action</result> <result name="unauthorized">/unauthorized.jsp</result> </global-results> <!-- other package declarations --> </package> |
...