What is the difference b/w forward and sendRedirect?

What is the difference b/w forward and sendRedirect?

Postby Kishan » Mon Feb 18, 2013 6:56 am

What is the difference b/w forward and sendRedirect?
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am

Re: What is the difference b/w forward and sendRedirect?

Postby Kishan » Sun Mar 24, 2013 5:11 am

forward:
one servlet/jsp forward request other servlet/jsp.
This will happen at server side.
only one request/response exchanged between browser and server.
This can only be used inside application context.

redirect:
one servlet/jsp redirect request to other servlet/jsp.
Two request/response exchanged between browser and server.
This can be used inside same or different application context.
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am


Return to Servlets

Who is online

Users browsing this forum: No registered users and 1 guest

cron