提交 d85c1fbd 编写于 作者: R Rossen Stoyanchev

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.
上级 3e390d1f
......@@ -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()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册