Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Invoke a class from different context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Invoke a class from different context" Watch "Invoke a class from different context" New topic
Author

Invoke a class from different context

Saravanan Vijayappan
Ranch Hand

Joined: Jan 02, 2007
Posts: 47
Hello

I have 2 servlet application running in my tomcat, let's say App1 and App2. I need to call CacheRefresh class in App1 from CachCallerClass from App2. How can i do this ?

Thanks


Cheers,<br />Sarav
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

You don't. Either include the class in both web apps, or expose the functionality via web service.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
Alternatively you can expose that as a plain servlet as well and invoke that using URLConnection.


My Blog
Saravanan Vijayappan
Ranch Hand

Joined: Jan 02, 2007
Posts: 47
I have chosen to use URL connection. Thank you!
 
GeeCON Prague 2014
 
subject: Invoke a class from different context