File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Sending data between two webapps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending data between two webapps" Watch "Sending data between two webapps" New topic

Sending data between two webapps

Ramu Nur

Joined: Aug 21, 2010
Posts: 22

I have an GWT application working perfectly currently. Say it as "APP1".The context path of APP1 is /APP1. Now I am introducing a new link into that application. Clicking on the new link will call home page of another GWT application, say "APP2". The context path of APP2 was different form APP1. The context path of APP2 is /APP2.

Can any one help me how to access the web application that was resided in different context path and how to forward the some data to second web application? I'm thinking it can be just a html href link with request data appended in the url...any clue?

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Ramu Nur wrote:I'm thinking it can be just a html href link with request data appended in the url.

That would be my guess, too. Web sites routinely include links to other web sites, after all. What happened when you tried it?
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 171

You could try with <cross-context> in your web.xml to inform the web container this web application is ready to send request to other resources(web applications). For examples with explanations: (I've not tried out this way)

No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
ntumba lobo
Ranch Hand

Joined: Oct 21, 2008
Posts: 180
I would make app1 send an HTTP request to app2 using a library like Jakart HTTP client.
If you use a GET meaning appending data to url you will be limited in the amount of data you can send,
you dont have this limitation with a POST that's why it's my preferred option.
I hope that will help

I agree. Here's the link:
subject: Sending data between two webapps
It's not a secret anymore!