How to pass a requrest object of one servlet as a request
object to another servlet?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pure servlet?

700


What are the benefits of using servlet over cgi?

583


If a servlet is not properly initialized, what exception may be thrown?

631


What are the types of Session Tracking ?

650


What do you mean by interservlet communication?

590






What is the difference between the include() and forward() methods?

573


What is life cycle of Servlet?

610


Why don't we write a constructor in a servlet?

594


What is a deployment descriptor?

602


What is the disadvantage of cookies?

582


Tell the new features added in servletrequest interface i.e. Servlet 2.4

577


why we should override only no-agrs init() method.

681


What is the process for chaining servlet?

613


What is the use of servletconfig interface?

561


How do we translate jsp?

578