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

How do I know if java is running on linux?

1176


What are its drawbacks of cgi?

1189


What is the procedure of invoking different servlet in a different application?

1062


What do you mean by cgi in servlet?

1126


What is the difference between 2 types of servlets?

1194


How httpservlet is different from the genericservlet?

1183


What is a cookie What is the difference between session and cookie

1140


Explain the custom jsp tags and the beans.

1120


How can you run a servlet program?

1137


What is called servlet container?

1149


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

1098


What is Servlets and explain the advantages of Servlet life cycle?

1168


What are the jobs performed by servlets?

1144


What do you mean by singlethreadmodel interface?

1095


What is difference between PrintWriter and ServletOutputStream?

1350