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

Answers were Sorted based on User's Feedback



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

Answer / janet

use a Request Dispatcher

Is This Answer Correct ?    8 Yes 0 No

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

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

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

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

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

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

Post New Answer

More Servlets Interview Questions

How httpservlet is different from the genericservlet?

0 Answers  


which type of data passing is used in realtime?

1 Answers  


What is the effective way to make sure all the servlets are accessible only when user has a valid session?

0 Answers  


What are the types of protocols supported by httpservlet ?

0 Answers  


What is the difference between genericservlet and httpservlet

0 Answers  






Differentiate between the web server and application server?

0 Answers  


Which exception is thrown if servlet is not initialized properly?

1 Answers  


Can we fetch the attributes related to a servlet on a different servlet?

0 Answers  


What is setattribute in servlet?

0 Answers  


Can we use the constructor, instead of init(), to initialize servlet?

0 Answers  


Which interface must be implemented by all servlets?

0 Answers  


What is difference between get and post method?

0 Answers  


Categories