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
How to rectify errors in java servlet while compilation?
Write a command to get actual path of a servlet to the server?
What do you understand by mime type?
why we should override only no-agrs init() method.
Explain jsessionid?
Explain load on start-up and its importance?
What is the capacity the doget can send to the server?
What is servletconfig?
What is the purpose of inter-servlet communication?
What is cgi and what are its drawbacks?
What do you mean by deployment descriptor?
How can we refresh automatically when new data has entered the database?
Is it possible to have a constructor inside the servlet?
What is servlet attributes and their scope?
Write a program to show the functionality of servlets.