Java 从上下文映射资源

Java 从上下文映射资源,java,spring,servlets,contextpath,Java,Spring,Servlets,Contextpath,我想从上下文映射资源文件夹中的文件夹 例如,在context.xml中(我想映射src/main/resources中的文件) 静态资源 类路径:/resources/myFolder/ /资源/ 在myFolder中,有许多包含文件的子文件夹和更多的子文件夹 但是firebug说错误404,这样的资源找不到最好通过mvcnamespace- <mvc:resources location="/resources/,classpath:/resources/myFolder" mapp

我想从上下文映射资源文件夹中的文件夹 例如,在context.xml中(我想映射src/main/resources中的文件)


静态资源
类路径:/resources/myFolder/
/资源/
myFolder
中,有许多包含文件的子文件夹和更多的子文件夹
但是firebug说错误404,这样的资源找不到

最好通过
mvc
namespace-

<mvc:resources location="/resources/,classpath:/resources/myFolder" mapping="/resources/**" />

那么您的静态资源应该可以从
http://serverurl/contextpath/resources/*

<mvc:resources location="/resources/,classpath:/resources/myFolder" mapping="/resources/**" />