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

What is load-on-startup in servlet?

1143


Write a simple servlet program to print the contents of html.

1044


What is meant by cookies?

1078


How do you invoke a servelt?

1122


Explain how to improve Servlet Performance?

1143


What is servlet container?

1114


What is the use of servletconfig interface?

1043


Explain the lifecycle of a servlet?

969


What do you mean by scope object and what are its types?

1068


What is the life cycle of a servlet?

1529


What do you mean by annotations in servlet?

1058


How does java thread pool work?

1089


What do you mean by a filter and how does it work?

951


Explain the role of dispatcherservlet and contextloaderlistener.

1187


What do you mean by singlethreadmodel interface?

1045