With theXmlViewResolver/ResourceBundleViewResolver you could have multiple instances of it and provide and XML application context to configure the views. This comes in handy when allowing 1 controller to render 2 different things like an Excel or a PDF depending on the requested Content-Type. Those are now deprecated and there is no real replacement for this.

Prior to this commit the BeanNameViewResolver would always resolve the views from the configuration it was defined in. Passing in a pre-configured application context would result in an error at runtime. Now it is possible to pass in an application context through the constructor which will be used to resolve the views from. Making it possible to have multiple instances and have the functionality as with multiple XmlViewResolver/ResourceBundleViewResolver with a ContentNegotiatingViewResolver.

Closes: #29383

Comment From: snicoll

Thanks for the PR but we don't feel that's the direction we want to approach this. I've reopened the related issue and tagged it accordingly.