A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. So once you get the RequestDispatcher, you could invoke include() or forward() function.
ServletContext.getRequestDispatcher(String path) requires the resource path to begin with "/", i.e. a path relative to context of your application. Lets say your application context path is /myapp, when a web request with any URL (localhost:8080/myapp/arbitrarydir1/dir2/myresource) path that invokes the servlet, doing ServletContext.getRequestDispatcher("/page2.jsp") will expect the file "page2.jsp" to be in directory /myapp/page2.jsp
Where as ServletRequest.getRequestDispatcher(String path) take the path relative to the path of resource being requested. So doing a ServletRequest.getRequestDispatcher("page2.jsp") while processing a request for
http://localhost:8080/myapp/module1/myresource, will look for page2.jsp under directory /myapp/module1/
and doing a ServletRequest.getRequestDispatcher("page2.jsp") while processing a request for
http://localhost:8080/myapp/moduleX/myresource, will look for page2.jsp under the following directory /myapp/moduleX/