localhost:8080要加项目名能访问的解决方法

修改tomcat目录下的conf/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" />
			   
        <Context path="" docBase="项目名" reloadable="true" /> <!-- 加上这句 -->
      </Host>

在<Host></Host>上 <Context path="" docBase="项目名" reloadable="true" />,然后就可以用localhost:8080直接访问到项目了

posted @ 2019-02-25 13:50  毛兔dimples  阅读(25)  评论(0编辑  收藏  举报