How to pass a requrest object of one servlet as a request
object to another servlet?
Answers were Sorted based on User's Feedback
Answer / hari
Use RequestDispatcher to pass a requrest object of one
servlet as a request object to another servlet.
One way of implementing this operation ,
RequestDispatcher rD = null;
rd = request.getRequestDispatcher("xxx.jsp (or) servlet");
rD.forward(request,response);
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / ravikiran(aptech mumbai)
using request.setAttribute("key",value) in the first servlet
and request.getAttribute("key") in the second servlet
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / priya
in an any web application when we have to pass object from
one servlet to another then we use request dispatcher.the
request dispatcher is used by using request.setAttribute
("key",value) in the first servlet and request.getAttribute
("key")in the second servlet.
| Is This Answer Correct ? | 0 Yes | 1 No |
What are the servlet events?
Why the concept of single thread model interface is used?
What are the objects involved when a servlet receives a call from client?
When to use doget() and when dopost()?
What's the advantages using servlets than using cgi?
when the webcontainer creates ServeletConfig,ServletContext objects? befoure creating the Servlet object or not?
Can we use javascript in Servlets?
What is session variable in servlets?
Describe servlet?
What is the difference between CGI and Servlet?
What is servlet exception?
6 Answers EDS, Spa IT Solutions,
What is Servlet API used for connecting database?