Correct check for ViewResolver beans
Check for bean names of type rather than actual beans. Issue: SPR-12267
This commit is contained in:
@@ -801,9 +801,9 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
|
||||
configureViewResolvers(registry);
|
||||
|
||||
if (registry.getViewResolvers().isEmpty()) {
|
||||
Map<String, ViewResolver> map = BeanFactoryUtils.beansOfTypeIncludingAncestors(
|
||||
String[] names = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(
|
||||
this.applicationContext, ViewResolver.class, true, false);
|
||||
if (map.isEmpty()) {
|
||||
if (names.length == 1) {
|
||||
registry.getViewResolvers().add(new InternalResourceViewResolver());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user