1. 程式人生 > >tomcat去掉專案名稱訪問專案配置

tomcat去掉專案名稱訪問專案配置

tomcat目錄中找到server.xml檔案,開啟檔案並找到<Host >向其中新增

<Context   path=""   docBase="F:/workplace/p1/WebRoot"   debug="0"/> 

docBase是專案的絕對路徑,如下所示:

      <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="D:\eclipse-jee-neon\apache-tomcat-8.0.37\wtpwebapps\OfficialWebsite" path="" reloadable="true" debug="0"/>
      <Context docBase="E:\result" path="/result" reloadable="true"/>
	  <Context docBase="D:\eclipse-jee-neon\apache-tomcat-8.0.37\wtpwebapps\OfficialWebsite" path="/OfficialWebsite" reloadable="true" source="org.eclipse.jst.j2ee.server:OfficialWebsite"/>
	  </Host>
重啟Tomcat