Originally posted by Madhav Lakkapragada:
RequestDispatcher from ServletRequest you can use relative paths (paths not starting with a "/") that are relative to the current request. You can also use absolute paths (paths starting with a "/") and these will be treated relative to the ServletContext or web-app root.
RequestDispatcher from the ServletContext must use a path that is relative ONLY to the ServletContext and ust start with a "/".
Originally posted by ks wong:
Try obtain a foreign context first, e.g. Servlet.getContext("/test"), then invoke getRequestDispatcher() on that context.