All,
I have 2 web applications, Web1 and Web2, deployed on my tomcat server. I want classes in Web1 to call methods on classes in Web2. One way to do this is using
Yes you can do it using javax.servlet.ServletContext and javax.servlet.RequestDispatcher API's. Here it is how it can be done from Web1:
ServletContext otherContext = servletContext.getContex("/Web2");
RequestDispatcher dispathcer = otherContext.getRequestDispatcher("/a/b.jsp");
dispatcher.forward(request, response);
//or
dispatcher.include(request, response);