A simple implementation of ViewResolver
that interprets a view name as a bean name in the current application context,
i.e. typically in the XML file of the executing DispatcherServlet.
This resolver can be handy for small applications, keeping all definitions
ranging from controllers to views in the same place. For larger applications,
XmlViewResolver will be the better choice, as it separates the XML
view bean definitions into a dedicated views file.
Note: This ViewResolver implements the Ordered interface
in order to allow for flexible participation in ViewResolver chaining.
For example, some special views could be defined via this ViewResolver
(giving it 0 as "order" value), while all remaining views could be resolved by
Note: To allow for ViewResolver chaining, a ViewResolver should
return null if a view with the given name is not defined in it.
However, this is not required: Some ViewResolvers will always attempt
to build View objects with the given name, unable to return null
(rather throwing an exception when View creation failed).