Dashboard > WebWork > ... > Result Configuration > Default results
  WebWork Log In View a printable version of the current page.  
  Default results
Added by Casey Moyaert, last edited by tm_jee on Jan 01, 2006  (view change)
Labels: 
(None)

Description

Webwork has the ability to define a default result type for your actions. Thus, you don't have to specify the result-type for results using the default. If a package extends another package and you don't specify a new default result type for the child package, then the parent package default type will be used when the type attribute is not specified in the result tag.

<!-- parts of xwork.xml  -->
....

<result-types>
 <result-type name="dispatcher" class="com.opensymphony.webwork.dispatcher.ServletDispatcherResult" default="true"/>
 <result-type name="redirect" class="com.opensymphony.webwork.dispatcher.ServletRedirectResult"/>
 <result-type name="velocity" class="com.opensymphony.webwork.dispatcher.VelocityResult"/>
</result-types>

....

<action name="bar" class="myPackage.barAction">

<!-- this result uses dispatcher, so you can omit the type="dispatcher" if you want -->
  <result name="success">foo.jsp</result>

<!-- this result uses velocity result, so the type needs to be specified -->
  <result name="error" type="velocity">error.vm</result>

</action>

....

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators