struts2 的 action 支持很多返回对象的类型,下表一一列出:
Most use cases can be divided into two phases. First, we need to change or query the application's state, and then we need to present an updated view of the application. The Action class manages the application's state, and the Result Type manages the view.
Predefined Result Types
The framework provides several implementations of the com.opensymphony.xwork2.Result
interface, ready to use in your own applications.
Used for Action Chaining | |
Used for web resource integration, including JSP integration | |
Used for FreeMarker integration | |
Used to control special HTTP behaviors | |
Used to redirect to another URL (web resource) | |
Used to redirect to another action mapping | |
Used to stream an InputStream back to the browser (usually for file downloads) | |
Used for Velocity integration | |
Used for XML/XSLT integration | |
Used to display the raw content of a particular page (i.e jsp, HTML) | |
Used to provide Tiles 2 integration | |
Used to provide Tiles 3 integration | |
Used to postback request parameters as a form to the specified destination | |
JSON Result | Used to serialize actions into JSON |
https://cwiki.apache.org/confluence/display/WW/Result+Types