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

How servlets are deployed in java?

965


How can we create deadlock situation in servlet?

1348


What do you mean by web applications?

1118


What methodology can be followed to store more number of objects in a remote server?

2208


What is the effective way to make sure all the servlets are accessible only when user has a valid session?

1004


What are the life cycle methods of the servlet?

1037


What are the two important api's in for servlets?

1014


How do cookies work in servlets?

997


Why are servlets used?

986


How to upload a file to the server using servlet?

952


What do you mean by url pattern in servlet?

1069


What is the difference between CGI and Servlet?

1010


What are the supporting protocol by HttpServlet ?

1112


A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?

1027


What is httpservlet class?

1056