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 |
Which HTTP method is non-idempotent?
What is a servlet context?
What are the annotations used in servlet 3?
What are the important functions of filters?
What are the difference between RMI and Servlets?
Which event is fired at the time of session creation and destroy?
can it possible to validate form field before execution of a servlet service method if yes how??
What is servlet instance?
can we create more than ServletContext and ServletConfig in your application
What happens, if server sends a cookie to a browser that doesn't supports cookies?
What are all the protocols supported by httpservlet?
What is new in ServletRequest interface ? (Servlet 2.4)