页面跳转

public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //meta 模拟头部
        String msg = "<meta http-equiv='refresh' content='3;url:www.baidu.com'>jump to another page!";
        //传数据
        this.getServletContext().setAttribute("msg", msg);
        //显示JSP
        this.getServletContext().getRequestDispatcher("/msg.jsp").forward(request, response);
    }
原文地址:https://www.cnblogs.com/lovemo1314/p/4678930.html