假设我有:
foo.war
bar.war
我是否有可能以某种方式将它们部署到相同的部署路径?例如,访问它:
war 文件的内容是否以某种方式合并?如何处理文件冲突(例如,假设它们都有一个 index.jsp
文件)?
提前致谢!
最佳答案
servlet 规范明确禁止这样做。已部署的 Web 应用程序可能没有相同或重叠的上下文根。来自 Servlet 3.0 规范,第 10.5 节:
Since the context path of an application determines the URL namespace of the contents of the Web application, Web containers must reject Web applications defining a context path that could cause potential conflicts in this URL namespace. This may occur, for example, by attempting to deploy a second Web application with the same context path.
关于java - 是否可以在同一个部署路径下部署多个war文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47287645/