How do you pass the data from one servlet to another
servlet?
Answer Posted / harish
Using Request Dispatcher, you can send the values and
forward to another page.
ServletContext.getRequestDispatcher();
reqDispatcher.forward(req,res)
Forwards a request from a servlet to another resource
(servlet, JSP file, or HTML file) on the server.
reqDispatcher.include(req,res)
Includes the content of a resource (servlet, JSP page, HTML
file) in the response.
Is This Answer Correct ? | 80 Yes | 22 No |
Post New Answer View All Answers
How many objects of a servlet is created?
Why is Servlet so popular?
How servlets are deployed in java?
Given the request path below, which are context path, servlet path and path info?
Can servlet have a constructor ?
Tell us something about servletcontext interface.
How forward () method is different from send redirect () method?
Differentiate between the print writer and servlet output stream?
What is the GenericServlet class?
What is api in servlet?
What is the difference between encodeRedirectUrl and encodeURL?
Explain url encoding in servlet?
How would you create deadlock on your servlet?
What do you mean by httpservlet and how it is different from the genericservlet?
Is servlet a controller?