After Action processes the request, it returns a string (logical view name). Struts2 decides which result to respond to according to the logical view name. It is necessary to provide an <result>
element definition result page in struts.xml.
<result>
Label properties:
- The name matches the return value of the method in the action and jumps.
- Type role: is used to define the jump method. Values that type can take:
- chain: It is equivalent to request forwarding. It is generally used to jump from one action to another.
- dispatcher: It represents request forwarding and is also the default value. It is generally used to jump from action to page.
- redirect: It represents a redirect and it is generally used to jump from action to page.
- redirectAction: It represents redirection and is generally used to jump from action to another action.
- stream: It means that the server returns a stream, which is generally used for downloading.