action type redirect 参数传递

在使用Struts2开发时,有时需要用redirect 来跟多个参数,然而我们直接?param1=${a}&param2=${b}。。是会被xml解析异常报错的,如下替换就可以了,      

<action name="SectionInfo!*" method="{*}" class="docroad.action.apps.SectionInfo">

           <result>/pages/apps/SectionInfo.jsp</result>

           <result name="list" type="redirect">/Sections.do?appid=${appid}&amp;pageNo=${pageNo}</result>

        </action>

<action name="enterpreinfo" class="preinfoBusinessAction" method="enterPreinfoSub"> <result name="success" type="redirect-action"> showpreinfo?preinfo.order_number=${preinfo.order_number}&amp;preinfo.company_name=${preinfo.company_name} </result> <result name="error" type="redirect"> <param name="location">/error.jsp</param> </result> </action>

猜你喜欢

转载自hsong.iteye.com/blog/1095024