And for some weird reason you want to call code of the other war.
You can write something like this in your servlet/jsp to get the context of the other war:
Now, when you have context to the war, you can access the objects under it. In example, you can include the other jsp in your request:
Looks simple? Well, it is. It even works on jboss, but it does not in tomcat: application.getContext("otherWarName") returns null, so you'll get the NullPointerException.
The missing part is configured in the conf/server.xml. You'll need to define cross context for the applications that you want to be accessible from the other applications. Under the host element add:
Recommended Reading1. Professional Apache Tomcat 6 (WROX Professional Guides)
2. Tomcat 6 Developer's Guide
3. Pro Apache Tomcat 6