There are two common ways to jump pages using JSP
1. Forwarding:forward action ID with execution request forwarding <jsp:forword>
<jsp:forward page="6-5-login.jsp" ></jsp:forward>
2. redirect redirect using the Sendredirect () method of the Response object
<% response.sendredirect ("jsp/login.jsp");%>
The redirect operation supports redirecting addresses to pages on different hosts than the current page, unlike forwarding, for example,
<% response.sendredirect ("www.baidu.com");%>
Their main difference is that one can carry data, one cannot.
The reason is that the next request will be made inside the server after the forwarding is executed, and the data will be returned to the browser.
Redirection is the ability to first respond to the browser and then make a request to the server without carrying the data.
3. Using JavaScript's internal object window's location () method
<script type="Text/javascript" >window.location.href="login.jsp"</Script >
4. As with JSPs, there are two ways that Servlets can jump pages: forward and redirection redirect
Forward
RequestDispatcher rd = Request.getrequestdispatcher ("path.jsp");
Rd.forward (request, response);
redirect
Response.sendredirect ("path.jsp");
1.jsp jump from the current page to another page (contains a method for jumping pages using JavaScript, servlet)