aspose file tools*
The moose likes Servlets and the fly likes how to communicate between 2 servlets which are present in two different web applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to communicate between 2 servlets which are present in two different web applications" Watch "how to communicate between 2 servlets which are present in two different web applications" New topic
Author

how to communicate between 2 servlets which are present in two different web applications

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
hi every one,

how to communicate between 2 servlets which are present in two different web applications?

case1: two web applications are deployed in the same server (for example tomcat)
case2: two web applications are deployed in two different servers (for example tomcat and weblogic)

need help


Abhishek
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
Java is loaded with tools for communicating between applications. One of the simplest would be a shared database.

What are the characteristics of the data which needs to be shared?
volume?
rapid change?
transactions?
... etc

Bill

Java Resources at www.wbrogden.com
Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
actually i was asked this in an interview ....
Frank Kellinghusen
Greenhorn

Joined: Jul 10, 2009
Posts: 11
Abhishek Reddy wrote:hi every one,

how to communicate between 2 servlets which are present in two different web applications?

case1: two web applications are deployed in the same server (for example tomcat)



You can get the ServletContext of another application running in the same server using getContext(String appUrl):

http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContext.html#getContext%28java.lang.String%29

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Can you not try opening a HTTPURLConnection to the other servlet ?


Regards
KumarRaja

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to communicate between 2 servlets which are present in two different web applications
 
Similar Threads
communicating between two web application
Doubts about Servlets and JSP(Please explain all my doubts with examples clearly)
Communication between servlets
Communicating Among differennt Applications in Tomcat
RESTEasy communication between two Web apps