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

First of all u have to set the value by setAttribute()
method such as:
getServletContext().setAttribute("variableName",object);

Then u have to forward that request to other servlet by
using that procedure,


RequestDispatcher rd=getServletContext
().getRequestDispatcher("/servlet");
rd.forward(request,response);

U can get that information from that servlet by using the
method::
getServletContext().getAttribute("variableName");

Is This Answer Correct ?    23 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of servlet context?

1010


What is the directory structure of web application?

946


What is called servlet container?

1055


What are session variable in servlets?

990


Which httpsession object is used to view and manipulate information about a session?

1121


List the Different types of servlet?

990


What do you mean by deployment descriptor?

979


Who is responsible for writing a constructor?

1217


What is the use of servlet wrapper classes?

1138


What are important features of Servlet 3?

1067


Which event is fired at the time of session creation and destroy?

1332


What are the different methods involved in generic servlet?

1056


What is the difference between genericservlet and httpservlet

1038


What are the differences between servlet context vs servlet config?

1038


When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?

1024