File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply 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: 12266
    
    1
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: 457

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


Regards
KumarRaja

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to communicate between 2 servlets which are present in two different web applications
 
Similar Threads
Doubts about Servlets and JSP(Please explain all my doubts with examples clearly)
Communicating Among differennt Applications in Tomcat
communicating between two web application
Communication between servlets
RESTEasy communication between two Web apps