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 can we upload the file to the server using servlet?

1003


What is servlet lazy loading?

1113


Explain the architechure of a servlet?

1062


Explain the role of dispatcherservlet and contextloaderlistener.

1124


What is the use of servlet wrapper classes?

1123


What is called a session?

1118


Differentiate between the print writer and servlet output stream?

955


What are life cycle methods of a servlet?

1011


Is tomcat a servlet container?

983


What is cookie? Why is cookie used?

1010


How native code can be used in a servlet?

4020


What is a servlet?

1078


Define context initialization parameters.

986


What are the ways to handle multi-threading in servlets?

1023


How the typical servlet code look like ?

1141