struts2 xml配置文件配置传参数
传参方式
重定向
第一方式:
<action name="search" method="search"
class="com.BatchFullTextSearchAction" >
<result name="success" type="redirect">/search/index/task_success.jsp?message=9999999</result>
</action>
<result name="error" type="redirect"> /login.jsp?userId=${orgStrucUser.userId}&error=1 </result>
<result name="success" type="redirect">/search/index/index.jsp?resultType=${#request.module}</result>(BatchFullTextSearchAction action里面定义一个module变量,写上getter、setter方法!)
第二方式:
<result name="error" type="redirect">
<param name="location">/login.jsp</param>
<param name="userId">${orgStrucUser.userId}</param>
<param name="error">1</param>
</result>
转发(界面request.getAttribute就可以获取到值了)
<action name="search" method="search"
class="com.BatchFullTextSearchAction" >
<result name="success" type="dispatcher">/search/index/task_success.jsp</result>
</action>
posted on 2013-11-08 17:00 lovebeauty 阅读(618) 评论(0) 编辑 收藏 举报