aspose file tools
The moose likes Servlets and the fly likes Communication between two web applications Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Communication between two web applications" Watch "Communication between two web applications" New topic
Author

Communication between two web applications

lakshmi v.samy
Ranch Hand

Joined: Feb 02, 2006
Posts: 30
Hi everybody

I have two web applcations which are running under one webserver.I want to make communication between two web applications.

Can anyone help me out on this.

Thanks in advance.
Janakiram Gattupalli
Greenhorn

Joined: Jul 30, 2006
Posts: 8
Hi Lakshmi,
it is quite simple.In order to esablish communication between two web applications running in the same web container,we use RequestDispatcher.forward() method.
For Ex app-x and app-y are two web applications running in Tomcat.

In app-x, we write

ServletConfig config=getServletConfig();
ServletContext context application=config.getServletContext();
ServeltContext anotherapp=application.getContext("/app-y");

using anotherapp ref we can access the objects in app-y application.
We can use rd.forward() to forward to the resource available in another web application.
[ February 10, 2007: Message edited by: Janakiram Gattupalli ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35229
    
    7
What exactly do you mean by communication? Do you have data or objects that you would like to share between both? Or do you want to send messages from one to the other?


Android appsImageJ pluginsJava web charts
lakshmi v.samy
Ranch Hand

Joined: Feb 02, 2006
Posts: 30
I have data in HTML file of first application and I would like to capture the data in the Second application.
[ February 13, 2007: Message edited by: Ben Souther ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by lakshmi v.samy:
I have data in HTML file of first application and I would like to capture the data in the Second application.

If that's all you need to do, it should be as simple as posting from one app to the other by setting your HTML form's attribute value to point to the other app.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: jrebel
 
subject: Communication between two web applications
 
Similar Threads
Differentiate!
Forward or Redirect http request to a web application on different web container/JVM with some param
How to do Communication between two web applications
open a new window navigator as a new session
SOAP Vs. EJB