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

Communication between two web applications

Anand Sivathanu
Ranch Hand

Joined: Jun 25, 2010
Posts: 76
Hi Friends,

I need to communicate to a servlet present in another web application of the same web container.

As I googled, I found of using getServletContext().getContext("/Cart");

Current web application is "HelloWorld" and I need to commuicate to Cart.

So i invoked


But I printed the value of otherContext, it is null.

so I not able to forward the req and res.



Please help.

Regards,
Anand
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42944
    
  68
Generally, this won't work. It can be made to work on some servlet containers via proprietary means. For Tomcat, that's what the crossContext attribute does.
Anand Sivathanu
Ranch Hand

Joined: Jun 25, 2010
Posts: 76
Thanks for your reply Ulf Dittmer. I will try the CrossContext
Mr. Ankur Garg
Greenhorn

Joined: May 27, 2012
Posts: 6

In a security conscious environment, the servlet container may return null for a given URL.
just check out about security issues..


Ankur Garg (SCJP,SCWCD)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communication between two web applications