Posts

Showing posts with the label static-resource

Static resource mapping in Spring3

Static resource mapping in Spring3 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 1 Answer 1 Use something like below : <mvc:resources location="/" mapping="/resources/**"/> You can specify classpath also to location any particular folder like below. <mvc:resources location="/, classpath:/META-INF/web-resources/" mapping="/resources/**"/> Project direc...