1、使用href超链接标记 <a href="url">跳转</a>
2、使用javascript,window.location.href="url"
3、提交表单,<form action="url"></form>
4、使用JSP动作,<jsp:forward page="url"/>
浏览器地址不变、可共享前一页面request里的数据、仅限同一Web应用程序内跳转
5、使用requestDispatcher类
RequestDispatcher rd = request.getRequestDispatcher("url");
rd.forward(response,request);
与forward动作跳转同理
6、使用response对象进行页面重定向,两种方法:
(1)response.sendRedirect();一般此句之后紧跟一句 return;
(2)response.setHeader("Refresh","1;url=目标页面");
2、使用javascript,window.location.href="url"
3、提交表单,<form action="url"></form>
4、使用JSP动作,<jsp:forward page="url"/>
浏览器地址不变、可共享前一页面request里的数据、仅限同一Web应用程序内跳转
5、使用requestDispatcher类
RequestDispatcher rd = request.getRequestDispatcher("url");
rd.forward(response,request);
与forward动作跳转同理
6、使用response对象进行页面重定向,两种方法:
(1)response.sendRedirect();一般此句之后紧跟一句 return;
(2)response.setHeader("Refresh","1;url=目标页面");
7、使用<meta>标签
<meta http-equiv="refresh"; content="300"; url=target.jsp">
参考:
http://blog.csdn.net/a597926661/article/details/7268068
http://www.jb51.net/article/21319.htm