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.

Chaining view resolvers demo

Chaining view resolvers demo

From the course: Spring: Spring MVC

Start my 1-month free trial

Chaining view resolvers demo

- So let's find out how to chain the view resolvers in your H+ application. So what I'm going to do is, the resource bundle view resolver that you have declared on line 65, I'm going to shut that off. I'm not going to use that one. We'll just command it out. Instead, I will use the XML View Resolver defined on line 58 so I'm going to uncommand 58 to 63, and also the internal resource view resolver is something that we want. So lines number 29 to 36 I will uncommand again. So now we have two view resolvers co-existing in our application, and we are going to employ a chaining mechanism for them. You can do that by setting an order as we discussed in the previous video. How do we do that? So let's come to line 33, press enter there, and let's do that at the end. So I'm going to go after 34, and on line 35 let's grab that view resolver object and there's a set order API to it. Set the order of this one to 2. I'll tell…

Contents