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:
request.setAttribute("variableName",object);

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

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

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

Is This Answer Correct ?    50 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by cgi and what are its drawbacks?

987


What is lazy loading and what is Generic Servlet Class?

1083


I Have A Plan to develop a Project in Struts,I want the template of struts project with Hibernate.Canany body provide me the required information?

2694


What is MIME Type?

1144


How do I use cookies to store session state on the client?

970


Difference between get and post in java servlets?

1038


What are the functions of the servlet container?

1628


What is difference between PrintWriter and ServletOutputStream?

1294


Write a program to show the functionality of doget and dopost method?

1221


What are the exceptions thrown by servlets? Why?

1173


Can you refresh servlet in client and server-side automatically?

1081


What are Servlets?

1126


Why doesn’t a servlet include main()?

1052


How can we implement a jsp page?

1138


What are the uses of servlets?

1142