File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes (Web Archieve) war to war communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "(Web Archieve) war to war communication" Watch "(Web Archieve) war to war communication" New topic

(Web Archieve) war to war communication

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
Hi Everybody

I have 2 web application app1.war and app2.war deploy in the same tomcat6.0 container. How to call function from app1.war to app2.war

Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

War files don't communicate with one another.
War files (Web Archives) are just a way of packaging a web application.

There are several ways that different web applications can communicate with one another.

There is also no such thing as a function in Java.

The servlet spec leaves some room for cross context communication but doesn't go into a lot of detail on how it should be implemented. Because of this you'll find inconsistent support and behavior between different containers and even different versions of the same container.

The getServletContext(contextname) method allows you to get a handle to other contexts runnning in the same container, from there, you should be able to work with objects from the other context. By default, Tomcat disallows this. To enable this, see 'crossContext' in this document:

Because much of this is Tomcat specific, and doesn't necessarily apply to all containers, I'm going to move this from JSP to our Tomcat forum.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
Hi Ben Souther

Thank You You give me a right direction to move.

Thank You Great Man
I agree. Here's the link:
subject: (Web Archieve) war to war communication
It's not a secret anymore!