|
Redirection: All variables stored in the previous request are invalidated and enter a new request scope.
Forwarding: The variables stored in the previous request will not become invalid, just like putting two pages together.
Start of text:
It looks different at first, and their calls are as follows:
request.getRequestDispatcher("apage.jsp").forward(request, response);//forward to apage.jsp
response.sendRedirect("apage.jsp");//Redirect to apage.jsp
In the jsp page, you will also see that forwarding is achieved in the following ways:
<jsp:forward page="apage.jsp" /> |
|