【发布时间】:2012-07-16 04:15:24
【问题描述】:
我想根据上下文将我的文件夹映射到资源文件夹中 例如,在 context.xml 中(我想从 src/main/resources 映射文件)
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="alwaysUseFullPath" value="true"/>
<property name="mappings">
<props>
<prop key="/resources/**">staticResources</prop>
</props>
</property>
</bean>
<bean id="staticResources" class="org.springframework.web.servlet.resource.ResourceHttpRequestHandler">
<property name="locations">
<list>
<value>classpath:/resources/myFolder/</value>
<value>/resources/</value>
</list>
</property>
</bean>
在myFolder 中有很多带有文件的子文件夹和更多的子文件夹
但萤火虫说错误 404 并且找不到此类资源
【问题讨论】:
标签: java spring servlets contextpath