【发布时间】:2018-04-27 13:21:13
【问题描述】:
我想将我的应用程序部署为根应用程序,因此我将我的战争重命名为 ROOT.war。默认 server.xml 看起来像 -
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
我还需要提供一些静态内容。所以我添加了上下文标签-
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<Context docBase="/home/athakur/Documents/UI" path="/" />
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
我想提供来自此路径的静态内容和来自我的 ROOT.war 的 api。但是,只要我添加上下文元素 ROOT.war 就不会扩展和部署。当我删除它的上下文路径时。 UI 也从添加上下文标记的路径后正确呈现。所以也不想改变这种行为。
【问题讨论】: