Monthly Archives: October 2010

Inter-Servlet Communication using a request dispatcher

In code, here is how to pull in data from a different JEE web-app

String pathToWebApp ="/otherApp"
String pathToServlet ="/myServlet" //relative to the otherApp context
ServletContext configContext = context.getContext(pathToWebApp);
RequestDispatcher dispatcher = configContext.getRequestDispatcher(pathToServlet);
dispatcher.include(request, response);