0

My project is implemented in Spring3 and configuration is almost xml. Configuration of static resource mapping is like below:

<mvc:resources mapping="/a/**" location="file:/data/a/"/>

There is no problem when accessing /a/xxx.jpg but 404 Error is occurred when accessing subdirectory like /a/b/yyy.jpg. There is no problem about access authority of filesystem. How can I solve this problem? Additional configuration is needed?

(Add) Project directory is fine, but filesystem directory does not work

4

1 回答 1

0

使用类似下面的东西:

<mvc:resources location="/" mapping="/resources/**"/>

您还可以指定类路径来定位任何特定文件夹,如下所示。

<mvc:resources location="/, classpath:/META-INF/web-resources/" mapping="/resources/**"/>
于 2018-06-29T09:24:04.123 回答