I am currently reading Spring in Action and I am trying to configure a view resolver in spring, however the book didn't say "How spring chooses which View Resolver to use" Its describer to configure the InternalResourceViewResolver
and how to add prefix and suffix. But, I could't not find how spring chooses which Resolver to use. What tell spring which resolver to use ?
Edited: quote from the book :
"" What’s missing here is how Spring knows about Tiles definitions. By itself, Tiles- ViewResolver doesn’t know anything about any Tiles definitions, but instead relies on a TilesConfigurer to keep track of that information. So we’ll need to add a Tiles- Configurer bean to spitter-servlet.xml: /WEB-INF/viewsviews.xml ""
The book never answered the question it asked: "how Spring knows about Tiles definitions"
DispatcherServlet
consults allViewResolver
s in the application context until one of them returns a view. - M. Deinumorder
attribute if defined. However if you have aUrlBasedViewResolver
as first in your view resolver chain the others will not be consulted. anUrlBasedViewResolver
simply creates a URL and forwards to that URL. It doesn't check if that URL actually results in a view to render. - M. Deinum