Originally posted by vishnu prakash:
Thanks Adeel Ansari.
I like to know the difference between RequestDispatcher in ServletRequest and ServletContext
In page 204 of Head First Servlet and Jsp book it says
Getting RequestDispatcher from ServletRequest
If the path does NOT start with forward slash,it is considered relative to the original request.
RequestDispatcher dispatch = request.getRequestDispatcher("TestJspOne.jsp");
This is a relative path(because there is no forward slash) So in this case the container looks for "TestJspOne.jsp" in the same logical location the request is "in".
Doesn't this mean that I should put the jsp in the same servlet package. Kindly explain me "relative path"
How to use this RequestDispatcher without a (slash). If I use like this where should I place the JSP file.