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 a servlet context?

1160


How can I send user authentication information while making URL Connection?

997


Does servlet have main method?

1184


What's the difference between servlets and applets?

1039


How do you create a cookie using servlet?

1165


Why HttpServlet class is declared abstract?

1213


What is the purpose of requestdispatcher interface?

1060


What are the various ways of session supervision in servlets?

996


Explain the difference between servlet and cgi?

1160


What do you mean by chaining in servlet?

1033


What is the default http method in the servlet?

1291


Explain web container.

1026


Explain the differences between jsp and servlet.

989


What are the common methods that are included in the http servlet class?

1036


When Servlet is unloaded?

1099