• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

(Web Archieve) war to war communication

 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

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.
 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben Souther

Thank You You give me a right direction to move.

Thank You Great Man
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic