Difference Between Forward and Redirect
Forward Method
- Forward only moves pages at the Web Container level. In practice, the web browser cannot tell that it has moved to another page. Therefore, the web browser displays the URL that was first called, and the URL information of the page that was moved to cannot be checked.
- The currently running page and the page called by forward share the Request object and Response object.

Statement used when moving from a Servlet to a JSP page
RequestDispatcher rd = request.getRequestDispatcher("test01.jsp");
rd.forward(request, response);
Redirect Method
- When a Redirect command enters the Web Container, it instructs the web browser to move to another page. Then the web browser changes the URL to the instructed address and moves to that address. It moves to an address in another web container.
- On the new page, new Request and Response objects are created.

Statement used when moving from a Servlet to a JSP page
response.sendRedirect("test02.jsp");