• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communication between two web applications

 
Anand Sivathanu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Ulf Dittmer. I will try the CrossContext
 
Mr. Ankur Garg
Greenhorn
Posts: 6
Java MyEclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a security conscious environment, the servlet container may return null for a given URL.
just check out about security issues..

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic