在两个WAR之间共享应用程序上下文? [英] Sharing an application context between two WARs?

查看:154
本文介绍了在两个WAR之间共享应用程序上下文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在两次部署的战争之间分享一个应用程序环境?一个战争需要引导另一个战争的服务,我不知道从哪里开始。

Is there a way to share an app-context between two deployed wars? One war needs to wire-in the services of another, and I don't know where to start with this.

推荐答案

像tomcat这样的Web应用程序容器的一般目的是每个应用程序都能够独立运行(所以你可以停止和启动单个应用程序而不影响其他应用程序),这意味着可能已经为开发工作专门防止了你这样做所以即使你发现了一个漏洞,我建议不要使用它,除非是建议或至少由设计师批准。

The general purpose of a web application container like tomcat is that each application is able to run independently (so you can stop and start individual apps without affecting others), which means that there has probably been a lot of effort put into their development specifically to prevent you from doing this. So even if you find a loophole, I would suggest against using it unless it is recommended or at least sanctioned by the designers.

我建议你开始寻找其他解决方案。例如:

I suggest you start looking for other solutions. For example:


  • 你真的需要共享对象实例吗?如果他们是无状态的,您可能不需要,您可以在每个应用程序中简单地运行上下文的副本。

  • 可以将您尝试共享的代码分成第三个WAR暴露了休息服务?或者也许现有的战争之一可以作为这项服务。

这篇关于在两个WAR之间共享应用程序上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆