如果主機的 deployXML 標志設定為 true,就可以使用上下文配置 .xml 文件以及一個可選的 .war 文件(或 Web 應用目錄)來進行 Web 應用部署。
在使用上下文 .xml 文件配置文件進行部署時,不會用到上下文路徑參數 /path。
上下文配置 .xml 文件包含用于 Web 應用上下文的有效 XML,就好像是在 Tomcat 的 server.xml 配置文件中進行配置一樣。范例如下:
http://localhost:8080/manager/text/deploy ?config=file:/path/context.xml&war=jar:file:/path/bar.war!/
可選的 war 參數被設定為指向 Web 應用的 .war 文件或目錄的 URL,它會覆蓋掉上下文配置 .xml 文件中的任意 docBase。
在下面這個實例中,使用上下文配置 .xml 文件部署 Web 應用:
http://localhost:8080/manager/text/deployconfig=file:/path/context.xml
在下面這個應用部署范例中,使用了上下文配置 .xml 文件和位于服務器中的 Web 應用的 .war 文件。
http://localhost:8080/manager/text/deploy
?config=file:/path/context.xml&war=jar:file:/path/bar.war!/