wood burning stoves 2.0*
The moose likes Servlets and the fly likes Application level communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Application level communication" Watch "Application level communication" New topic
Author

Application level communication

Vrushali Gore
Ranch Hand

Joined: Oct 17, 2005
Posts: 40
I have designed two web applications using servlets. Can servlet of one web application communicate with servlet of another web application
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

It depends on what you mean by communicate.

Can you tell us what you're trying to do?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Vrushali Gore
Ranch Hand

Joined: Oct 17, 2005
Posts: 40
I want to send some data from servlet in one web application to servlet in another web application.

Let's say I am having 2 webapps like abc.war(having servlet A) & xyz.war(having servlet B) so from now servlet A data is to be transferred to servlet B

Thanks for your reply.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
There are any number of ways: HTTP (which might be easiest), shared files, web service, JMS, Email, shared DB, TCP/IP, ...

Direct access to objects or sessions in another web app can be enabled on some servlet engines, but is server-specific. For Tomcat, have a look at the crossContext attribute of the Context. It enables the use of RequestDispatchers across web apps.
[ August 24, 2006: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Vrushali Gore
Ranch Hand

Joined: Oct 17, 2005
Posts: 40
Thanks for your reply.
Do Tomcat only provides the way? Servlet technology is not having any approach to this. Suppose if two webapps are running in the same webserver or two webapps are running in differnet servers do i will have to go for some other mechanism?

If you can elaborate your answer more i would be very thankful to you.

Thnaks once again.
 
jQuery in Action, 2nd edition
 
subject: Application level communication