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

Who is responsible to create the object of servlet?

1205


What is the directory structure of a war file?

1170


What is difference between PrintWriter and ServletOutputStream?

1294


How can the session in servlet be destroyed?

1160


What is servlet and its types?

1058


What exception should be thrown when servlet is not properly initialized?

1011


What is the type of method for sending request from http server?

1108


How forward () method is different from send redirect () method?

969


Why is httpservlet declared abstract?

1117


What are the life-cycle methods for a servlet?

998


How to find whether a parameter exists in the request object?

1110


What do you mean by session tracking?

1217


How can a servlet be used to generate plain text instead of html?

954


How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255

3395


If a servlet is not properly initialized, what exception may be thrown?

1184