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

for example if you want to pass your name from one servlet
to another,

in fiest servlet file....

String name = "Tom"
request.setAttribute("name",name);

RequestDispatcher dis = request.getRequestDispatcher
("Servlet2");

request.Forward(request,response);



in second servlet file....

request.getAttribute("name");
//this line will display "Tom"

Is This Answer Correct ?    46 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are all the ways for session tracking?

1088


What is load-on-startup in servlet?

1069


What are the new features added to servlet 2.5?

1041


What’s the difference between genericservlet and httpservlet?

1018


What is the difference between jsp and servlet life cycle?

1173


Can we override destroy method in servlet?

937


What do you mean by the servlet chaining?

1005


List the Different types of servlet?

982


What are the types of servlet?

1212


How can you create a session in servlet?

1084


Why do we need a constructor in a servlet if we use the init method?

985


what is multiple server?

2254


What is Servlet API used for connecting database?

1043


What is dispatcher servlet?

1008


Explain the difference between generic servlet and http servlet?

939