sevlet跳转到jsp

servlet使用RequestDispatcher到jsp页面
String   url="/EShop.jsp";  
ServletContext   sc   =   getServletContext();  
RequestDispatcher   rd   =   sc.getRequestDispatcher(url);  
rd.forward(req,   res);

servlet重定向jsp,并将数据发送到别一个JSP中:   
request.setAttubute("messages",aaa);     
RequestDispatcher   requestDispatcher=request.getRequestDispatcher("/jsp/testbean.jsp");  
requestDispatcher.forward(request,response);

你可能感兴趣的:(jsp)