<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
        <Context path="/FoodStore-Images" docBase="D:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\FoodStore\FoodStore-Images" ></Context>

        <!-- 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 &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/>

</Host>

再tomcat的conf\server.xml的host标签下加上 <Context path="/FoodStore-Images" docBase="D:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\FoodStore\FoodStore-Images" ></Context>代码,即可用http://ip地址:端口号/FoodStore-Images/文件名.后缀名  来访问"D:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\FoodStore\FoodStore-Images"路径下的文件资源。

相关文章:

  • 2021-09-01
  • 2021-05-21
  • 2022-12-23
  • 2021-08-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案