I am trying to access a web application that was in different context in the same server (Tomcat 6.0.26). I had writtem below code in server.xml file (Path: \Apache Software Foundation\Apache Tomcat 6.0.26\conf\server.xml).
in the server.xml there is one proerty called crossContext. if you will set it to true, it allows the ServletContext.getContext() method to successfully return the ServletContext for other Web applications running in the same host.
subject: Setting up CrossContext configuration in Tomcat