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 is an application exception handling is done using a servlet?
What are the annotations used in servlet 3?
What do you mean by request dispatcher in servlet? Also explain its methods.
what is multiple server?
What is servlet initializer?
What is servlet in tomcat?
What is the difference between servlet and filter?
how the HTML data stored in web server?
What is the difference between the include() and forward() methods?
What is the workflow of a servlet?
Why servlet is used as controller ? Not JSP? I want complete explation?
List out the difference between ServletConfig and ServletContext?
What is url encoding and url decoding
Explain url encoding?
What is the directory structure of web application?