Communication between two web application in same server

后端 未结 5 1786
攒了一身酷
攒了一身酷 2020-12-09 10:41

All,

I have 2 web applications, Web1 and Web2, deployed on my tomcat server. I want classes in Web1 to call methods on classes in Web2. One way to do this is using

5条回答
  •  [愿得一人]
    2020-12-09 11:23

    Package the classes you want to share between web applications into a separate jar. Put them under common/lib so that the common classloader will load the classes and would be available to both web applications. Then expose the instance in web2 using jndi, look up them from web1 and invoke the methods.

提交回复
热议问题