<!-- tomcat默認配置 不支持短路徑訪問-->
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
<!-- tomcat指定短路徑的訪問方式。 支持短路徑訪問,但是會出現Spring定時器同時啓動兩次-->
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context path="" docBase="D:\tools\tomcat\webapps\test" debug="0" reloadable="true"/>
</Host>
<!-- tomcat指定短路徑的訪問方式。 支持短路徑訪問,刪除appBase 解決Spring定時器同時啓動兩次-->
<Host name="localhost" appBase="" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context path="" docBase="D:\tools\tomcat\webapps\test" debug="0" reloadable="true"/>
</Host>
解決方案1. path爲空 ,docBase指定絕對路徑 appBase爲空;
解決方案2. webapps下的war包命名爲ROOT.war,tomcat使用默認配置,不支持完成路徑;