What is the difference between callling a RequestDispatcher
using ServletRequest and ServletContext?
Answers were Sorted based on User's Feedback
Answer / mahesh
We can give relative URL when we use ServletRequest and not
while using ServletContext.
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / prachetash
RequestDispatcher rd = request.getRequestDispatcher("result.jsp")
This is relative path, becoz there is no "/" slash.Container looks in same logical path.
RequestDispatcher rd = getServletContext.getRequestDispatcher("/result.jsp")
Is This Answer Correct ? | 0 Yes | 0 No |
Whether thread can be used in servlets?
What is the main purpose of java servlets?
How do you invoke a Servlet? What is the difference between doPost method and doGet method?
Which event is fired at the time of session creation and destroy?
can u give some realtime example in ploymorphism? and inheritance?
List out the difference between ServletConfig and ServletContext?
How do cookies work in servlets?
How can I share objects across different sessions?
How can we implement a jsp page?
Servlet Chaining? How do you do the Filtering in Servlets?
What do you mean by mime type?
Hi Friends, Can we make any method thread safe withour synchronized keyword?