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
Whether we can get deadlock situation in servlets?
What do you mean by httpservlet?
What's the servlet interface?
What is the difference between the include() and forward() methods?
What are the functions of the servlet container?
Explain the difference between servletconfig and servletcontext in servlet?
How we can get ip address of client in servlet?
The code in a finally clause will never fail to execute, right?
What are the uses of servlet and what is servlet chaining?
What is servlet instance?
Describe in brief RequestDespatcher?
What are all the advantages of servlet over cgi?
Is servlet a controller?
what is servlet chaining?
What is lazy loading and what is Generic Servlet Class?