在Struts的action中,最后需要return一个ActionForward来从获取Struts文件中的配置项,从而映射到相应的jsp页面
但是,普遍用的都是return mapping.getInputForward("input"),来找到Struts.xml文件中<forward>标签的name属性,该例子用的是input作为name属性的值。
Struts默认的就是input,在<action>标签中进行设值,action标签中有一个名字叫做input的属性,该属性可以直接配置jsp页面的路径,也可以配置参数用来映射<forward>标签的name属性。
如:
1.使用 return mapping.getInputForward("input");
<action name="trustChangePasswordForm" path="/trust/accoreq/changepassword"
type="org.springframework.web.struts.DelegatingActionProxy"
parameter="method" validate="false" scope="request">
<forward name="input" path="result.jsp" />
</action>
2.使用 return mapping.getInput();
<action name="trustChangePasswordForm" path="/trust/accoreq/changepassword"
type="org.springframework.web.struts.DelegatingActionProxy"
parameter="method" validate="false" scope="request"
input="result.jsp">
</action>
或者:
<action name="trustChangePasswordForm" path="/trust/accoreq/changepassword"
type="org.springframework.web.struts.DelegatingActionProxy"
parameter="method" validate="false" scope="request"
input="changeresult">
<forward name="changeresult" path="result.jsp" />
</action>