Difference between Forward and SendRedirect in JSP

RequestDispatcher.forward() and HttpServletResponse.sendRedirect() are the two methods available for URL redirecting to another jsp or servlet.

sendRedirect() is more flexible than forward() because with sendRedirect() you can connect to any URL outside the webapplication whereas forward() will work only within the web application.

sendRedirect() is slower than forward()

sendRedirect() is on the client side whereas forward() is on the server side

Comments