How many ways are available to ger RequestDispatcher object?
Answer Posted / rice
There are two 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);
| Is This Answer Correct ? | 17 Yes | 0 No |
Post New Answer View All Answers
What are important features of Servlet 3?
Explain the servlet filter.
What are the advantages of servlets over traditional cgi?
What is servlet in simple terms?
What is servlet invoker?
How to get the IP address of client in servlet?
What is java servlet session?
How can we refresh automatically when new data is entered into the database?
Explain the working of service() method of a servlet.
Which interface should be implemented by all servlets?
What are some disadvantages of storing session state in cookies?
Why is httpservlet declared abstract?
What’s the difference between forward() and sendredirect() methods?
Why doesn’t a servlet include main()?
What is difference between cookies and httpsession?