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 is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
What are the various ways of session supervision in servlets?
Explain request dispatcher and its methods.
How to read request headers from servlets?
How do you configure a centralized error handler in servlets?
What are the supporting protocol by HttpServlet ?
What are the functions of the servlet container?
What are the life-cycle methods for a servlet?
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
Is servlet a server side scripting language?
What are the uses of servlet
What are Servlets?
What is the functionality of actionservlet and requestprocessor?
Why are servlets used?
What methods do you use in servlet - applet communication?