From the course: Spring: Spring MVC

Unlock the full course today

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

Using ResourceBundleViewResolver

Using ResourceBundleViewResolver

From the course: Spring: Spring MVC

Start my 1-month free trial

Using ResourceBundleViewResolver

- [Instructor] Let us now see how do you resolve views through a ResourceBundle file. The process is pretty much similar to the way we have done the XmlViewResolver stuff. Let's go through the steps one-by-one. The first thing is you will have to configure the ResourceBundleViewResolver in your application configuration. So let's head back to IDE and let's go down there. On line 64, I'm going to instantiate a bean. And what is that for? That is for the ResourceBundleViewResolver. Let us also instantiate it. And to this we are going to set the base name. So base name, let's say is views. That's all. And let's just return this viewResolver. So what does this configuration mean? We are saying that all our views are now defined in a properties file. The name of the properties file, the base name is views. It's going to take up a properties file because it's ResourceBundleViewResolver. You do not have to tell it…

Contents