How two servlets communicate with each other?

Answers were Sorted based on User's Feedback



How two servlets communicate with each other?..

Answer / tulasi vani

Servlets communicate with each other with the help of
RequestDispatcher objects.

RequestDispatcher rd=getServletConfig().getNamedDispatcher
(...);

... name used to identify a servlet i.e. name given in the
web.xml in the url-pattern

Is This Answer Correct ?    17 Yes 1 No

How two servlets communicate with each other?..

Answer / devendra

Servlets can communiceate with the help of RequestDispacher.

RequestDispacher rd = getRequestDispacher("passing the 2nd servlet url");
rd.forward(rquest,response);

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More Servlets Interview Questions

What is a generic servlet?

0 Answers  


What is meant by session? Tell me something about httpsession class?

0 Answers  


can i modify the data which are generated by the servlet

4 Answers  


What are the drawbacks of cgi?

0 Answers  


What is difference between GenericServlet and HttpServlet?

0 Answers  






Where do you define dispatcherservlet?

0 Answers  


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

0 Answers  


java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null while working with struts it displayed pls very ungent

3 Answers   IBM,


How can you run a servlet program?

0 Answers  


What are the uses of servlets?

0 Answers  


What is http servlet in java?

0 Answers  


When to use doget() and when dopost()?

0 Answers  


Categories