struts1 forward 请求带参数

如果action配置中,加了scope="request"属性,则在业务处理完成转发到新请求时,通过request.setAttribute("id",1);这种直接传参到新请求不成功,有两种方法解决
1.直接在action中 return new ActionForward("a.do?id=1");

2.return new ActionForward(mapping.findForward("SUCESS").getPath() + "?id=1");

猜你喜欢

转载自jslfl.iteye.com/blog/1597203