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 |
Is it possible to call servlet with parameters in the URL?
What is ServletContext object?
Difference between get and post in java servlets?
What is meant by a servlet?
What is the need of session tracking in web application?
How to handle the debug errors in servlets?
how the HTML data stored in web server?
why business logic written using servlets not in jsp. Jsp used for presentation purpose. serlvet used for coding business logic and controller logic. Reason for using servlets in business logic.
How to get the actual path of servlet in server?
How do I support both get and post from the same servlet?
What is cgi and what are its drawbacks?
Is servlet thread safe?