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
If a servlet is not properly initialized, what exception may be thrown?
What are different Authentication options available in Servlets.
Define the servlet mapping.
What do you mean by cgi?
What is servlet invoker?
Given the request path below, which are context path, servlet path and path info?
Servlet is pure java object or not?
Can filter be used as request or response?
Explain the features are in servlet 3?
How to handle exceptions thrown by application with another servlet?
What is load-on-startup in servlet?
Explain the difference between generic servlet and http servlet?
Explain the difference between get and post method in servlet?
How servlet is created?
What is the advantage of Servlets when compared with other server side technologies?