tomcat如何访问非webapp下的资源文件

只要在%tomcathome%\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 &quot;%r&quot; %s %b" />
        <Context docBase="D:/websites/" reloadable="true" debug="0" path="/files"/>
      </Host>
复制代码

 

posted @   发疯的man  阅读(1434)  评论(0)    收藏  举报

喜欢请打赏

扫描二维码打赏

了解更多

喜欢请打赏

点击右上角即可分享
微信分享提示