Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoke a class from different context

 
Saravanan Vijayappan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't. Either include the class in both web apps, or expose the functionality via web service.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively you can expose that as a plain servlet as well and invoke that using URLConnection.
 
Saravanan Vijayappan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have chosen to use URL connection. Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic