if (beanFactory.containsBean(viewName)) {
final Class<?> viewBeanType = beanFactory.getType(viewName);
// viewBeanType could be null if bean is abstract (just a set of properties)
if (viewBeanType != null && AbstractThymeleafView.class.isAssignableFrom(viewBeanType)) {
view = (AbstractThymeleafView) beanFactory.configureBean(view, viewName);
} else {
// The AUTOWIRE_NO mode applies autowiring only through annotations
beanFactory.autowireBeanProperties(view, AutowireCapableBeanFactory.AUTOWIRE_NO, false);
// A bean with this name exists, so we apply its properties
beanFactory.applyBeanPropertyValues(view, viewName);