Struts 2 Result Types

ResultTypes: Result types and result is specified in struts.xml configuration file for specified action usin the result tag.

Different Result types:

Dispatcher Result Type: To dispatch the request to a jsp page to include or forward content. It is the default one.


<result name="success">

Redirect Result: To redirect to another URL (web resource). It is like response.sendRedirect().


<result name="success" type="redirect">
       <param name="location"<
      </param >

Redirect Action Result: To redirect to another action mapping

Chain Result: For Action Chaining

FreeMarker Result: For FreeMarker integration


<result name="success" type="freemarker"<
            <param name="location">/</param>

HttpHeader Result:Used to control special HTTP behaviors.

Stream Result: Used to stream an InputStream back to the browser (usually for file downloads).

Velocity Result: For Velocity integration.

XSL Result:Used for XML/XSLT integration.

PlainText Result:Used to display the raw content of a particular page.

Tiles Result:Used to provide Tiles integration.