From the course: Spring: Spring MVC

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Using XmlViewResolver

Using XmlViewResolver

From the course: Spring: Spring MVC

Start my 1-month free trial

Using XmlViewResolver

- [Instructor] Let us now find out how do you resolve your views through an XML file. The first step to do that is , configure the XML view resolve bean in your application configuration. So this is talking about the spring context configuration. Let's go to the IDE and grab our configuration file, which is this one. And inside this, we are going to instantiate a bean. That bean is going to be the XML view resolver. So let's provide a method for this. Let the return type be XML view resolver, give the same name. And what is this going to do? It's going to say XML view resolver distantiate that, and this XML view resolver is supposed to pick out the definitions from an XML file. So we will have to tell this resolver that the XML file resides at a particular location on the class path. How do we do that? you can invoke an API. So let's go to the next slide and save view resolver.set location, and this…

Contents