servlet跳转
1.request.getRequestDispatcher("main").forward(request,response);
2.pageContext.getServletContext().getRequestDispatcher("main").forward(request,response);
3.<jsp:forward page="main"></jsp:forward>
4.response.sendRedirect("main");
5.response.setHeader("main","");
//此语句前不允许有out.flush(),如果有,页面不会跳转
js跳转
6.<meta http-equiv='refresh' content='1;url=main'/>
7.window.location.href="main";
8.window.navigate("main");
9.window.location.replace("main");
10.self.location='main';
11. top.location='main';
12. window.history.back(-1);
window.history.go();
1.request.getRequestDispatcher("main").forward(request,response);
2.pageContext.getServletContext().getRequestDispatcher("main").forward(request,response);
3.<jsp:forward page="main"></jsp:forward>
4.response.sendRedirect("main");
5.response.setHeader("main","");
//此语句前不允许有out.flush(),如果有,页面不会跳转
js跳转
6.<meta http-equiv='refresh' content='1;url=main'/>
7.window.location.href="main";
8.window.navigate("main");
9.window.location.replace("main");
10.self.location='main';
11. top.location='main';
12. window.history.back(-1);
window.history.go();