You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ContentNegotiatingViewResolver supports a property with nested ViewResolvers. When using Java-based configuration this property is likely to be populated with ViewResolvers created in the same method and not by an ApplicationContext. Some ViewResolvers however implement ApplicationContextAware and depend on access to an ApplicationContext (e.g. UrlBasedViewResolver and sub-classes).
Of course it is possible to create the nested ViewResolvers from separate @Bean methods but that's not ideal and seems to defeat the purpose of having nested ViewResolvers in the first place. Instead the ContentNegotiatingViewResolver can check if the provided ViewResolvers are registered in the container and if not initialize them through the BeanFactory.