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 / venkat

forward() method send source prg to target web resource prg
in same web application.and use source and target web
resource prg are use same req,res objects so will use data
in target web resource prg.

rd.forward(req,res)

sendRedirect() method send source web resource prg to target
web resource prg in same webapplication or two different web
applications in same server or different servers.and this
method will not use same req,res objects so if you want to
send data source to target web resource prg use query
string.

r.sendRedirect("srv2"?a=10);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to read request headers from servlets?

1049


Explain load on start-up and its importance?

1139


When a servlet accepts a call from a client, it receives two objects. What are they?

1245


How do you deal property files in servlet?

1071


How do you invoke a servelt?

1126


How do servlets work?

1037


Servlet is pure java object or not?

1193


What is the major difference between context parameter and context attribute?

1116


What is the purpose of dispatcherservlet properties?

1118


What are the drawbacks of cgi?

1039


If servlet receives multiple requests, how many objects will it create?

1385


How printwriter is different from servletoutputstream?

1014


How do you get the ip address of the client in servlet?

1012


What do you mean by cgi and what are its drawbacks?

987


What is preinitialization of a servlet?

1027