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
HttpServletResponse.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 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain web container.

1026


When servlet object is created?

1153


What mechanisms are used by a Servlet Container to maintain session information?

1163


How can a servlet be used to generate plain text instead of html?

951


Explain how to improve Servlet Performance?

1140


What is difference between GenericServlet and HttpServlet?

1162


What is cookies in servlet with example?

1118


What is Servlet API used for connecting database?

1097


What is the servlet?

1087


What is difference between cookies and httpsession?

1089


What is the inter-servlet communication?

1171


What are the life cycle methods of the servlet?

1079


What is http servlet in java?

1066


Explain jsessionid and when is it created?

1110


How do you load an image in a Servlet?

1184