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 httpservlet is different from the genericservlet?

1183


Can we use the constructor, instead of init(), to initialize servlet?

1150


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

1309


If some new data has entered the database, explain how can a servlet refresh automatically?

1350


Explain jsessionid and when is it created?

1186


What is difference between jsp and servlet?

1210


What is the difference between 2 types of servlets?

1194


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

1079


How do you create a cookie using servlet?

1224


What are the drawbacks of cgi?

1114


Which event is fired at the time of setting, getting or removing attribute from application scope?

1189


What is servlet invoker?

1085


What is the difference between Servlets and Applets?

1091


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

1105


Explain the servlet filter.

1041