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 is difference between PrintWriter and ServletOutputStream?
Which HTTP method is non-idempotent?
What is the GenericServlet class?
Is servlet thread safe?
Why do we need servlet filter?
What do you mean by cgi in servlet?
What is the dispatcher servlet?
What are some disadvantages of storing session state in cookies?
When servlet is loaded?
What is servlet? Explain
why we should override only no-agrs init() method.
Whether thread can be used in servlets?
How do you find out what client machine is making a request to your servlet
What is difference between jsp and servlet?
Can filter be used as request or response?