[tip] jsp的两种跳转方式     摘要:本文摘录了只带session的跳转和既带session,也带request的跳转两种方式。http://blog.csdn.net/cm4ever/archive/2004/10/20/143921.aspx

解决方案 »

  1.   

    response.sendRedirect()指重新开始一个request生命周期,所以以前存在request自然就不存在了,
    forward指在服务器端接着执行下一个页面,但是现在还没有刷新缓存,以前在request的东西自然还在,使用sendRedirect,和forward都使用一个String参数,使用前,最好使用response.encodeURL编码,不然哟可能会字符出错
      

  2.   

    我用
    request.getRequestDispatcher("http://localhost:8080/site/index.jsp").forward(request,response);
    出现如下错误:type Status reportmessage /http:/localhost:8080/victualer/queryinput.jspdescription The requested resource (/http:/localhost:8080/victualer/queryinput.jsp) is not available.