Tomcat 8 - 静态资源/资产无法实现这一点

时间:2014-04-05 20:39:48

标签: java tomcat tomcat8

C:\ asset(我有像.jpg / 2.jpg / 3.jpg等图片)

我的tomcat server.xml如下所示:

  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">
    <Context path="/test" docBase="C:/asset" debug="0" reloadable="true" crossContext="false"/>

    <!-- 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" />
  </Host>

仍然当我去localhost:8080 / test / 1.jpg我有404错误任何想法为什么这不起作用?

另一个问题是有可能在我的春季项目中配置这条路径吗?作为变量?

0 个答案:

没有答案