What is the difference between callling a RequestDispatcher
using ServletRequest and ServletContext?
Answer Posted / 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 |
Post New Answer View All Answers
How can I send user authentication information while making URL Connection?
What are the functions of an intercepting filter?
Why do we have servlet filters?
How to get the path of servlet in the server?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
Explain servlet life cycle?
Explain the different ways for servlet authentication?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
Whether thread can be used in servlets?
The code in a finally clause will never fail to execute, right?
Can you use javascript in servlets?
What is load-on-startup in servlet?
Can you explain in detail 'javax.servlet' package?
Is servlet a controller?
What are important features of Servlet 3?