因为你用的是forward,request都被传递下去了,如果不需要的话,用redirect就可以了。

解决方案 »

  1.   

    小弟初学struts,不太清楚.
    在BookAction.java( 继承了Action)
    如何用redirect? 如有代码最好.万谢.
      

  2.   

    public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception
    {
    return mapping.findForward("sortAction");
    }我以前是这样写的.应该在什么地方用redirect??
      

  3.   

    在struts的配置里面可以配置forward的方式为redirect,你可以查一下struts的文档。
    另外或者硬编码:response.sendRedirect(...)
      

  4.   

    to redv(upas)
    可是我在BookOpAction中要处理BookAction的request里的内容BookOpAction在forward之前也request.setAttribute("",obj)了,
    是不是就没有办法了.
      

  5.   

    你的意思是说你在BookAction中已经把Book.jsp的请求参数用request.setAttribute()设置了,你想在BookOpAction中看不到Book.jsp的请求,只看到上一步中的request.setAttribute()的值。这是做不到的,因为一旦你redirect了就没有request了。我想你没有必要这么复杂地搞,除非你设计有问题。