File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes communicate between 2 war files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "communicate between 2 war files" Watch "communicate between 2 war files" New topic
Author

communicate between 2 war files

Ganesh Kannusamy
Ranch Hand

Joined: Sep 15, 2005
Posts: 35
hi friends,
I need to communicate(vice-versa) between two web-applications,(WAR)files, Is there any method to communicate between them.

Thanks
Ganesh


Thanks,
Ganesh
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Where this two WAR were located ?? In the same server or in an intranet ?
Please explain about the current system/software scenario to help you further...


Spritle Software Blogs
Ganesh Kannusamy
Ranch Hand

Joined: Sep 15, 2005
Posts: 35
Hi Balaji,
Both the war files are located in the same server(Tomcat5 Or Oc4j 9g). I need to send/receive some parameters between the two applications.
First War file - application is developed in MVC-2 framework,
Second War file - application is developed in Struts1.2 framework.

Thanks in advance
Ganesh.K
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
You can use any communication mechanism you can think of:
  • a database
  • a shared file
  • TCP or UDP
  • JMS
  • Email
  • a web service
  • HTTP
  • RMI
  • on Tomcat, you can even set the web apps so that you can get a RequestDispatcher in one web app for a resource in the other one
  • ...


  • Ping & DNS - my free Android networking tools app
    Ganesh Kannusamy
    Ranch Hand

    Joined: Sep 15, 2005
    Posts: 35
    Hi Ulf,
    Thank you for your reply, indeed a lot of communication mechanism is available.
    Will JMS be suited for communication between Struts based application(since iam a newbie in JMS).

    Thanks in advance,
    Ganesh.K
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42276
        
      64
    Which method is suitable depends largely on what your requirements are. Do you need one-way or two-way, synchronous or asynchronous, how fast does it need to be, do you have some of these technologies already available, ... Without knowing these it's impossible to even make an educated guess.
    Ganesh Kannusamy
    Ranch Hand

    Joined: Sep 15, 2005
    Posts: 35
    My requirements are,
    It is a two-way, asynchronous communication.
    It should be very fast.
    The technologies i already have are RMI, SOAP, HTTP.

    From my requirements can you figure out which suits me best.
    Iam ready to implement JMS or TCP/UDP or any other best suited mechanism, but not Database


    Thanks,
    Ganesh.K
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42276
        
      64
    For two-way asynchronous I'd recommend JMS. If speed if important, I'd prefer synchronous mechanisms, though. Since both sides are web apps, HTTP suggests itself for that - just send the request, and ignore the response.
    Peer Reynders
    Bartender

    Joined: Aug 19, 2005
    Posts: 2922
        
        5
    I've never tried this before but I've wondered if it would be possible to "communicate" between two co-located web applications by using ServletContext.getContext(String uriPath) and RequestDispatchers (or even ServletContext listeners).
    Java Forums - ServletContext's getContext() method
    [ March 06, 2006: Message edited by: Peer Reynders ]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: communicate between 2 war files