因为在conf/server.xml中把webapps做为appBase。可查看server.xml中的如下代码,并注意到appBase="webapps":
<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>
还可注意到我们访问localhost:8080时,会自动定位到ROOT项目,如果想重新设置默认项目的话,可以进行如下设置,即添加一行新的代码:
<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="newproject" debug="0" reloadable="true"/>
</Host>