How two servlets communicate with each other?
Answers were Sorted based on User's Feedback
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 |
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 |
What is servlet api used for conneting database?
Can I override destroy() method of Servlets?
When servlet object is created?
program for RequestDispatcher in servlets?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
Can we define constructor in Servlet class?
Directive Include and Action Include how both are working in JSP, what is the difference between both?In which suituation we have to choose these elements?
What is the directory structure of a war file?
Which httpsession object is used to view and manipulate information about a session?
My Question is that i am using <image> tag in my servlet and after compilation after that calling by url in my browser then images are not showing. Sometime images are showing and sometime is not showing. I am using Tomcat to run my servlets. Tell me if there any specification for image in servlets or what is solution for this ??
Explain the role of dispatcherservlet and contextloaderlistener.
What is the difference between an applet and a servlet?
15 Answers GCEW, Miracle Solutions,