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 are the mechanisms used by a servlet container for maintaining session information?

558


Explain the features are in servlet 3?

597


What are the advantages of servlets over traditional cgi?

618


Difference between doget and dopost?

677


How can the referrer and the target urls be used in servlet?

524






Define the life cycle of a servlets.

567


Is it possible to have a constructor inside the servlet?

550


How servlet is created?

538


What is servlet looping or chaining?

649


How to make sure a servlet is loaded at the application startup?

545


What is the major difference between servlet and applet?

537


What is pure servlet?

691


What is the process to implement doget and dopost methods?

540


What is getservletcontext?

544


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

613