Versions Compared

Key

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

...

Code Block
titleSetting a default Result Type
<result-types>
   <result-type name="dispatcher" default="true"
                class="org.apache.struts2.dispatcher.ServletDispatcherResult" />
</result-types>

If a type attribute is not specified, the framework will use the default dispatcher type, which forwards to another web resource. If the resource is a JavaServer Page, then the container will render it, using its JSP engine.

...

See Parameters in configuration results for an expanded discussion.

 

Returning Result Objects

Instead of configuring results and returning the name, it is possible to return a result object:

Code Block
languagejava
public Result runAction() {
	ServletDispatcherResult result = new ServletDispatcherResult();
	result.setLocation("input-form.jsp");
	return result;
}