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 are the phases of a servlet life cycle?
What is a servlet engine?
Explain web application directory arrangement?
Define context initialization parameters.
What are the jobs performed by servlets?
What is cookie in servlet?
What are the key methods that are involved in processing of http servlets?
What are the different methods involved in generic servlet?
Which HTTP method is non-idempotent?
Which is the methods of generated servlet?
Can you call a jsp from the servlet?
Whats the advantages using servlets over using CGI?
What are important features of Servlet 3?
What is servlet and how it works?
What is pure servlet?