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 / vinod muda

In First Servlet i.e Test

String name = "Vinod";
request.setAttribute("name",name);
RequestDispatcher dis = request.getRequestDispatcher
("Test2");
dis.forward(request, response);
---------------------------------------
Now in Second Servlet i.e Test2

String name = (String) request.getAttribute("name");

Is This Answer Correct ?    29 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How the typical servlet code look like ?

1134


Explain how to improve Servlet Performance?

1084


What are Servlets?

1047


When servlet object is created?

1069


What is the importance of init() method in Servlet ?

1031


How can an existing session be invalidated?

1097


What’s the use of the servlet wrapper classes??

1062


What are all the advantages of servlet over cgi?

1018


What is the difference between sendredirect() and forward() in a servlet?

952


How can you run a servlet program?

1028


What are sessions in servlets?

1014


Explain the different ways for servlet authentication?

1028


What is the difference between using getSession(true) and getSession(false) methods?

987


explain the advantages of servlet life cycle?

928


What are the different ways we can maintain state between requests?

1044