
What's the difference between forward and sendRedirect?

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
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.