response.sendRedirect(path);不对,使用forward

解决方案 »

  1.   

    呵呵!简单哦!
    转发的时候用res.getRequestDispatcher("index.jsp").forward(request,response);
    你用response.sendRedirect(path)是重定向!呵呵!当然是错的!呵呵!
      

  2.   

    response.sendRedirect(path);
    这样在新的页面里的request和response就和前面的没有任何关系了。
    需要用forward 来跳转
      

  3.   

    靠 都这么快,我看是0回复的时候,开始写的……
    居然那么多了。楼上均正确。
    getRequestDispatcher("index.jsp").forward(request,response); 才能把request和response传导下一个页面。
      

  4.   

    想用redirect只能放到session里了,
    可以参考一下我们对forward和redirect的解释:http://www.family168.com/tutorial/jsp/html/jsp-ch-03.html
      

  5.   

    request.getSession().setAttribute(arg0, arg1)就可以了呀,,
    提取的时候request.getSession().getAttribute(ar0)