In Struts2, when the action finishes processing a user request, a string object is returned, which is a logical view name. Struts 2 by configuring the mapping relationship between the logical view name and the physical view, once the system receives a logical view name returned by the action, the system renders the corresponding physical view to the viewer.
The result type of Struts 2 determines that after the action is finished, the next step is to call that view resource to render the processing result. The default is dispatcher, which specifies that the JSP is used as the view resource. But we have the requirement that we move from one action to another.
By jumping from one action to another, struts provides two types of results: chain, redirect.
<action name= "Sousuo" class= "com.sunlawer.action.SearchAction" >
<result>/index.jsp</result >
<result name= "Lawerlist" type= "Chain" >lawerListAction</result>
<result name= "Anli" Type= "Chain" >lawerCaseAction</result> <result name= "Zaixianzixun" type= "Chain
" >zaixianzixun </result>
</action>
Among them, Lawerlistactiion and Lawercaseaction and Zaixianzixun are the names of the target action to go to, which are already configured in the Struts2 configuration file. For example:
<action name= "lawerlistaction" class= "com.sunlawer.action.LawerAction" >
<result name= "Success" >/ Lushijieshao.jsp</result>
</action>