Home » Interview Questions » JSP Interview Questions » What is the difference between forwarding a request and redirecting a request?
 

What is the difference between forwarding a request and redirecting a request?

REDIRECT:
Sends a header back to the browser, which contains the name of he resource to be redirected to. The browser will make a fresh equest from this header information. Need to provide absolute URL path.

Has an overhead of extra remote trip but has the advantage of being able to refer to any resource on the same or different domain and also allows book marking of the page.

FORWARD:
Forward action takes place within the server without the knowledge of the browser, for this no extra network trip is required.



Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code: