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...

How do you pass the data from one servlet to another
servlet?

Answer Posted / harish

Using Request Dispatcher, you can send the values and
forward to another page.
ServletContext.getRequestDispatcher();
reqDispatcher.forward(req,res)
Forwards a request from a servlet to another resource
(servlet, JSP file, or HTML file) on the server.
reqDispatcher.include(req,res)
Includes the content of a resource (servlet, JSP page, HTML
file) in the response.

Is This Answer Correct ?    80 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is servlet and its use?

1170


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

1089


What is URL Encoding?

1283


Can you send an authentication error from a servlet?

1029


What is a java servlet?

1152


What are all the ways for session tracking?

1228


Which httpsession object is used to view and manipulate information about a session?

1230


How can we implement a jsp page?

1204


Why is a constructor needed in a servlet even if we use the init method?

1214


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

1085


What is meant by session? Tell me something about httpsession class?

1086


Why do we have servlet listeners?

1131


What is the web server used for running the Servlets?

1069


Is java servlet still used?

1094


How do we call one servlet from another servlet?

1103