wood burning stoves 2.0*
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending data between two webapps" Watch "Sending data between two webapps" New topic
Author

Sending data between two webapps

Ramu Nur
Greenhorn

Joined: Aug 21, 2010
Posts: 22
Hi,

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?

Thanks,
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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: 166

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)

https://cwiki.apache.org/GMOxDOC22/creating-deployment-plans-for-web-applications.html
http://oreilly.com/java/archive/tomcat-tips.html


No pain, No gain.
OCJP 1.6
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


SCJP 5 , SCWCD 5, SCEA 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending data between two webapps