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
Why do we have servlet wrapper classes?
How can we include static files in the jsp page?
Explain session tracking and its importance?
What are the advantages of servlets over traditional cgi?
Why are http servlets used in programming?
How do we share data using 'getservletcontext ()?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
Can you refresh servlet in client and server-side automatically?
What are the disadvantages of storing session state in cookies?
How can we refresh automatically when new data has entered the database?
What is the difference between genericservlet and httpservlet
What are some disadvantages of storing session state in cookies?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
What is URL Encoding?
Why the concept of single thread model interface is used?