RequestDispatcher rd = request.getRequestDispatcher("SecondServlet");
rd.forward(request, response);

解决方案 »

  1.   

    response.sendRedrect(String url);
      

  2.   

    response.sendRedirect()
    //
    Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root. 
      

  3.   

    <meta http-equiv="refresh" content="1 url=MsgShow.jsp"> 
    这个自动跳转
      

  4.   

    response.sendRedrect(String url);
      

  5.   

    使用response.sendRedrect(String url);调转后将产生一个新的请求所以在他之后最好加上return;
      

  6.   

    response.sendRedrect(String url);//jsp 的跳转
    <meta http-equiv="refresh" content="[time] url=[url]">//html的跳转,[time]的单位是毫秒