*
The moose likes Tomcat and the fly likes Communicating Among differennt Applications in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Communicating Among differennt Applications in Tomcat" Watch "Communicating Among differennt Applications in Tomcat" New topic
Author

Communicating Among differennt Applications in Tomcat

Deepika Saxena
Ranch Hand

Joined: Jul 05, 2009
Posts: 59
Hi,
is it possible to communicate among the applications that are deployed in tomcat?
for example, if we have app1 , app2 and app3 running in a tomcat server and if we want to interact between app1 and app2 , can we do it? if so, please tell how to achieve this.

Thanks.
--Deepika.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60755
    
  65

I'd set them up as web services.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Deepika Saxena
Ranch Hand

Joined: Jul 05, 2009
Posts: 59
Thanks Bibeault. is this the only possible way to interact between two web applications? isn't there any other scope which allows to interact among different web applications that are deployed in the same server?

--Deepika
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60755
    
  65

No, though its one of the cleanest.

You can just post normal requests back and forth between them as well.

There are some cross-context tricks that Tomcat allows, but I avoid them because they are non-standard and are trouble just waiting to happen.
Deepika Saxena
Ranch Hand

Joined: Jul 05, 2009
Posts: 59
Thanks Bibeault.
--Deepika
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Web requests - be they ReST, Web services/SOAP or roll-your own are the most portable way of inter-app communication.

If your Tomcat is embedded in a full J2EE stack server such as JBoss, you can also use EJBs and/or JMS.

There are many other ways as well, but most of the others are rather specialized and not as simple/portable.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communicating Among differennt Applications in Tomcat
 
Similar Threads
Session time out
JBoss in Action: different class loaders for each web application
Tunneling Concept Query
How to replicate sessions between two web applications on the same tomcat?
Lock wait timeout exceeded