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
Explain the difference between a web server and a web container?
What is the difference between Difference between doGet() and doPost()?
How do you configure a centralized error handler in servlets?
What are session variable in servlets?
What exactly are the functions of servlet?
Explain the steps involved in placing a servlet within a package?
Can we override servlet service method?
What do you mean by annotations in servlet?
Describe in brief RequestDespatcher?
What's the difference between authentication and authorization?
Whether we can get deadlock situation in servlets?
What are the differences between the servletconfig interface and the servletcontext interface?
What are the features added in Servlet 2.5?
How to read request headers from servlets?
What are its drawbacks of cgi?