请求重定向到一个页面按如下配置没有问题:
<result name="goto" type="redirect">http://localhost:8080/system/sysLogin.html?method=validatorAjax</result>
加入一个参数,
<result name="goto" type= "redirect">http://localhost:8080/system/sysLogin.html?method=validatorAjax&userName=${userName}</result> 
配置文件报错,按提示更改的写法如下都不好用。
<result name="goto" type= "redirect">http://localhost:8080/system/sysLogin.html?method=validatorAjax;userName=${userName}</result> 
<result name="goto" type= "redirect">http://localhost:8080/system/sysLogin.html?method=validatorAjax
<param name="userName">${userName}</param>
</result> 
那么传递多个参数应该如何写strutsredirect

解决方案 »

  1.   

    要给userName提供set get方法才行的
      

  2.   

    <package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters">
       <-- Pass parameters (reportType, width and height) -->
       <!--
       The redirect-action url generated will be :
       /genReport/generateReport.jsp?reportType=pie&width=100&height=100#summary
       -->
       <action name="gatherReportInfo" class="...">
          <result name="showReportResult" type="redirect">
             <param name="location">generateReport.jsp</param>
             <param name="namespace">/genReport</param>
             <param name="reportType">pie</param>
             <param name="width">100</param>
             <param name="height">100</param>
             <param name="anchor">summary</param>
          </result>
       </action>
    </package>参考下
      

  3.   

    <result name="goto"这儿name值和参数要一致
      

  4.   

    http://blog.sina.com.cn/s/blog_6c9d5da50100y41l.html