Fix initialization issue in ResourceUrlProvider

Before this change ResourceUrlProvider used getUrlMap to detect
ResourceHttpRequestHandler instances, however the map may contain bean
names as is the case when using <mvc:resources>. Instead it now uses
getHandlerMap.
This commit is contained in:
Rossen Stoyanchev 2014-09-04 00:11:28 -04:00
parent 3e390d1f7f
commit d85c1fbdd5
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
Collections.sort(handlerMappings, new OrderComparator());
for (SimpleUrlHandlerMapping hm : handlerMappings) {
for (String pattern : hm.getUrlMap().keySet()) {
Object handler = hm.getUrlMap().get(pattern);
for (String pattern : hm.getHandlerMap().keySet()) {
Object handler = hm.getHandlerMap().get(pattern);
if (handler instanceof ResourceHttpRequestHandler) {
ResourceHttpRequestHandler resourceHandler = (ResourceHttpRequestHandler) handler;
if (logger.isDebugEnabled()) {