Description: In many previous cases, the action we used basically inherits from the actionsupport class. In this class, we define five fields: Success, none, error, input, loging. We can directly return these field values, which are defined in the form of string success = "success", so we only need to use them in lower case in the result element.
<Result> the complete standard format is as follows:
<Result
Name = "success"
Type = "dispatcher">
<Param
Name = "location">/Default. jsp </param>
</Result>
If we use the default format, we can end up with: <result>/Default. jsp </result>
Type type:
Type Value |
Description |
Corresponding class |
Chain |
Used to process the action chain |
Com. opensymphony. xwork2.actionchainresult |
Dispatcher |
It is used to redirect to a page. |
Org. Apache. struts2.dispatcher. servletdispatcherresult |
Redirect |
Redirect to a URL |
Org. Apache. struts2.dispatcher. servletredirectresult |
Redirectaction |
Redirect to an action |
Org. Apache. struts2.dispatcher. servletactionredirectresult |
Plaintext |
Displays the source file content, such as the source code. |
Org. Apache. struts2.dispatcher. plaintextresult |
Freemarker |
Process freemarker templates |
Org. Apache. struts2.views. freemarker. freemarkerresult |
Httpheader |
Result type that controls special HTTP Behaviors |
Org. Apache. struts2.dispatcher. httpheaderresult |
Stream |
Sends an inputsream object to a browser, which is usually used to process file downloads and return Ajax data. |
Org. Apache. struts2.dispatcher. streamresult |
Velocity |
Process the velocity Template |
Org. Apache. struts2.dispatcher. velocityresult |
XSLT |
Process XML/XLST templates |
Org. Apache. struts2.views. XSLT. extends tresult |