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.

Convertors overview

Convertors overview

From the course: Spring: Spring MVC

Start my 1-month free trial

Convertors overview

- [Instructor] Now let us go to the concept of convertors and Spring MVC. Now, convertors extends the binders concept further and provides you one more way of customization. So let's say on your clients site on a GSB you have a form which captures the value of city. And on the server side, the city field is represented by a graph of Java objects. So let's say there a person bean first. Inside that there's an address bean and finally within, there's a city string value. So now, the question is, how do we map that city value from the form to the city attribute of the address bean composed inside the person bean? So this is a graph of objects and then how do you set the value from the form to the respective Java attribute is something that you will have to tell Spring MVC about. Spring MVC wouldn't be able to do this kind of conversion and that's exactly where you have convertors coming to your rescue. It's used basically…

Contents