Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Communication between two web applications  RSS feed

 
lakshmi v.samy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
lakshmi v.samy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!