What’s the difference between sendRedirect and forward methods ?
4 years ago
OOP Java
The sendRedirect method creates a new request, while the forward method just forwards a request to a new target. The previous request scope objects are not available after a redirect, because it results in a new request. On the other hand, the previous request scope objects are available after forwarding. FInally, in general, the sendRedirect method is considered to be slower compare to the forward method.
Surya Bikram Bhandari
Oct 31, 2021