2 Minutes To Code (β Version)

JSP - 2 minute tutorial

Url redirection - How to redirect to any webpage on any server

Redirecting means that when an http client requests a webserver for a particlular url the webserver in turn can ask the htp client (web browser etc) to instead get a different url (may be because a page has moved to a different domain).

The example below shows how to redirect request to a different page using sendRedirect(String url) method on the implicit response object.
Unlike jsp forward action which can only forward to another url in the same webapp, a redirect can point to any page on any webapp or even a different domain altogether.

Moreover, in a redirect, the webserver sends the http url to the http client which then itself loads the different url. Where as in a forward action, the webserver itself get the forwarded page, processes it and sends its output to the http client.