Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is difference between Forward() and sendRedirect()
methode?

Answer Posted / farhaananwar

Foward action is done at server site without interference of
web browser even the old URL is not changed whereas request
is forwarded to new resource hence forward action is faster
than redirect action. when forward operation is performed
request attributes and session attributes persists.
In case of redirection. servlet container sends the
response to clien web browser by setting status to
HttpServletRequest.SC_TEMPORARY_REDIRECT and location header
to the new URL address where browser will have to redirect
new request automattically without interference of client.
when browser redirect new request to resource, the URL in
web browser changed. This proccess is slower than forward
because server send response to browser telling that
resource requested is moved temporary to other resource and
need redirction and then browser take action. The request
paramters are persist in new redirect request.

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are all the advantages of servlet over cgi?

1085


What are all the protocols supported by httpservlet?

1277


What's the advantages using servlets than using cgi?

998


What is the GenericServlet class?

1231


Can you call a jsp from the servlet?

1019


How do we share data using 'getservletcontext ()?

1042


What is MIME Type?

1142


What is a servlet?

1141


What is the difference between servlet and jsp?

1115


How do you run a servlet?

1058


What is SingleThreadModel interface?

1147


What do you mean by deployment descriptor?

1056


What exception should be thrown when servlet is not properly initialized?

1006


How do you communicate in between Applets and Servlets?

1063


Explain the difference between jsp and servlet?

1073