In the reference documentation:
A BeanNameViewResolver with id “beanNameViewResolver”. This is a useful member of the view resolver chain and will pick up any beans with the same name as the View being resolved. It can be overridden by providing a bean of the same type, but it’s unlikely you will need to do that.
In fact, the autoconfiguration is conditional only on the presence of any View beans.
@Bean
@ConditionalOnBean(View.class)
public BeanNameViewResolver beanNameViewResolver() {
It would make more sense for the autoconfigured bean to be created only if (a) a BeanNameViewResolver was not present and (b) at least one View bean was present.