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 types of an http request?
How the servlet is loaded?
Hi Frieds, I am new to servlet why to use servlet in webapplication. what i know is " use servlet as a controller in mvc and to implemnent business logic . is it correct ? One more thing reason for implementing business logic with servlets , why not jsp.
What is done after deploying a war file and before client gives a request
Is it possible to send a mail from a servlet? Explain?
What is the difference between JspWriter and PrintWriter
What are the steps that are required to handle the multi-threading?
How variables can be accessed across the sessions?
what is the difference b/w DispatchAction and LookUpDispatchAction?
1 Answers Deloitte, iGate, Tech Mahindra,
What is filter? Can filter be used as request or response?
What are the disadvantages of storing session state in cookies?
how to make the IP address to .com