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
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 >>
List the Different types of servlet?
What is dispatcher servlet?
request parameter how to find whether a parameter exists in the request object?
Explain the features are in servlet 3?
What are the benefits of using servlet over cgi?
How to commuincate between an applet and a servlet?
What is the use of java servlet api?
What are the uses of servlet and what is servlet chaining?
Can we get PrintWriter and ServletOutputStream both in a servlet?
What are the types of an http request?
What are the different methods involved in generic servlet?
How can we invoke another servlet in a different application?
When should you prefer to use doget() over dopost()?
What is servletconfig?