How two servlets communicate with each other?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by httpservlet and how it is different from the genericservlet?

625


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

661


What is the requirement of servlet config and servlet context implemented and how are they implemented?

629


Why do we need a constructor in a servlet if we use the init method?

595


What are the kinds of http requests?

687






Why HttpServlet class is declared abstract?

725


How do you invoke a servelt?

710


Explain the difference between servletconfig and servletcontext in servlet?

653


What is meant by servlet? What are the parameters of the service method?

666


When Servlet is unloaded?

717


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

712


How is the get () method different from the post() method?

617


Explain the war file?

686


Write a program to show the functionality of doget and dopost method?

758


What is servlet invoker?

671