我想知道有没有一种方法可以将 war 复制到另一个名称的 webapps 文件夹,当然是自动的,并且使用一些 xml 文件的最少配置。
示例:我有一个.war 并想要一个服务器文件夹和服务,但不需要“一个”文件夹和服务
谢谢帕维尔
编辑 29.9.11 (7:30):我在 server.xml 中复制了类似的东西
<Context docBase="a" path="/AServer" reloadable="true" source="org.eclipse.jst.jee.server:a" />
如果存在一些删除文件夹的参数或一些禁用启动“a”服务器的其他 xml,那就太好了
编辑 29.9.11 (14:53) 我找到了一些方法。向 server.xml 添加 deployIgnore="a.war, a"参数 - 主机和上下文几乎相同并且几乎可以正常工作(不读取 conf/Catalina/localhost 中的上下文),但仍然存在一个文件夹并且可能是这不是一个好方法。
<Context docBase="a" path="/AServer" reloadable="true" />
谁有更好的办法?
最佳答案
来自 Tomcat's The Context Container documentation :
path
...
This attribute must only be used when statically defining a Context in server.xml. In all other circumstances, the path will be inferred from the filenames used for either the .xml context file or the docBase.
一种解决方案是重命名 war 文件。另一种方法是按照@mooreds 的建议将其解压缩到 AServer
文件夹。
关于tomcat - 将 tomcat 上的 war 部署到另一个文件夹名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7569108/