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 |
Why are servlets used?
How can I share objects across different sessions?
how a user session can be tracked in servlets?
What are different ways for servlet authentication?
What is the life cycle of a servlet?
What exactly are the functions of servlet?
Is java servlet still used?
Explain request dispatcher and its methods.
What is Servlet API used for connecting database?
What are different types of SessionTracking?
When the methods init() and Distroy() will be called?
what is EJB and Java servlet