写新项目的时候手动更改了Tomact启动的默认路径,但每次Tomact启动时手动更改的server.xml文件总是被自动还原,后发现在Eclipse目录下也存在一个server项目,每次运行Eclipse时里面的server.xml自动覆盖了tomact下的server.xml
下面是Tomact启动路径的手动配置文件
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="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" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/><Context docBase="hotelsystem" path="/hotelsystem" reloadable="true" source="org.eclipse.jst.jee.server:hotelsystem"/>
</Host>
即在Host标签下加上Context标签
<Context docBase="hotelsystem" path="/hotelsystem" reloadable="true" source="org.eclipse.jst.jee.server:hotelsystem"/>