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 happens if we wont use destroy()?
How two servlets communicate with each other?
How can we invoke another servlet in a different application?
Which interface should be implemented by all servlets?
How do cookies work in servlets?
What is a servlet engine?
What do you mean by default initialization in java servlet?
What is context in servlet?
Can we use threads in Servlets?
What is the use of attribute in servlets?
What is difference between Forward() and sendRedirect() methode?
What is difference between cookies and httpsession?