How do you pass the data from one servlet to another
servlet?

Answer Posted / tulasi vani

We can pass the data from one servlet to another using
RequestDispatcher object.


1.RequestDispatcher rd=getServletContext.getNamedDispatcher
("...");
rd.forward(request,response);

... means use the name of the url-patterns you have
specified for the servlet in web.xml.

Is This Answer Correct ?    34 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>

2713


List the Different types of servlet?

770


What is dispatcher servlet?

770


request parameter how to find whether a parameter exists in the request object?

763


Explain the features are in servlet 3?

794


What are the benefits of using servlet over cgi?

762


How to commuincate between an applet and a servlet?

767


What is the use of java servlet api?

765


What are the uses of servlet and what is servlet chaining?

768


Can we get PrintWriter and ServletOutputStream both in a servlet?

874


What are the types of an http request?

794


What are the different methods involved in generic servlet?

793


How can we invoke another servlet in a different application?

898


When should you prefer to use doget() over dopost()?

829


What is servletconfig?

729