How many ways are available to ger RequestDispatcher object?
Answer Posted / seshendra
There are three ways to get RequestDispatcher object in the
servlet.
1. calling the getRequestDispatcher(String path) method on
ServletRequest.
RequestDispatcher rd=request.getRequestDispatcher(String path);
2. By getRequRequestDispatcher(String path) method on
ServletContext.
RequestDispatcher rd=context.getRequestDispatcher(String path);
3.by calling getNamedDispatcher(servlet logical name)on
ServletContext object
RequestDispatcher rd=context.getNamedDispatcher(servlet
logical name)
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What is Servlets and explain the advantages of Servlet life cycle?
Why HttpServlet class is declared abstract?
What methods do you use in servlet - applet communication?
Explain servlet life cycle?
What are the types of servlets? Explain
Why the concept of single thread model interface is used?
How do cookies work in servlets?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
How to commuincate between an applet and a servlet?
Can you explain in detail 'javax.servlet' package?
What is called Session Tracking?
What is the difference between forward () and sendredirect () functions in servlet? Explain
How are filters?
What is MIME Type?
What must be implemented by all servlets?