Spring MVC provides a very flexible view resolution mechanism that is fully decoupled from the other elements of the MVC framework. It does not force you to use a particular view technology; rather, it makes it easier to use your own favorite technology. It even allows you to mix and match multiple technologies at the view tier. Spring MVC provides out-of-the-box support for JPS, XSLT, and Velocity views.
In a typical Spring MVC application, the developer chooses a view technology of his choice and accordingly uses a ViewResolver
that resolves views built using that technology.
The component responsible for resolving views in a Spring MVC application is org.springframework.web.servlet.ViewResolver
. It maps logical view names with physical view resources and the chosen view technology.
All request-handling methods of controllers must resolve a logical view name by either returning a view name, a view object, or a ModelAndView
object. The org.springframework...