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’s the difference between genericservlet and httpservlet?
What is the need of servlet filters?
When we don't write any constructor for the servlet, how does container create an instance of servlet?
What do you mean by web applications? Explain web application directory arrangement?
What is servlet and list its types?
Explain the servlet filter.
How we can call a jsp from the servlet?
What is called servlet container?
What is ServletContext object?
can servlet have instance variables?
init() method of servlet loaded by?
How many ways to remove the session object in the container