When dispatching requests to servlets using request.getRequestDispatcher("/servlet/servletX") how is the file structure evaluated?? since while using request to get the dispatcher the current location of the request is important...
for example: context: catalog current request: catalog/user/create.jsp What happens if I try to dispatch the request to the path "/servlet/servletX"?? what happens if I try to dispatch the request to the path "servlet/servletX"?? thanks, in advance...
Enthuware Software Support
posted 11 years ago
If you give a relative path (one that does not start with /)such as getRequestDispatcher("hello.jsp"), the the path of the current jsp is important. In this case, hello.jsp has to be inthe same directory as the current jsp. Otherwise, the path is evaluated from the document root and does not depend on the path of the current jsp.