Join Shonna Smith for an in-depth discussion in this video Binder methods, part of Spring: Spring MVC (2018).
- [Instructor] So now let's talk about another way…you can manipulate your model…by something that Spring calls binder methods.…You can add an init binder annotation…to methods to register any controller-specific conversion…or formatting behavior.…You would use init binders to manipulate data…that comes in in your request parameters,…anything in your URI variables,…or any aspect of your model objects.…
Let's take a look at an example to see what I mean.…So once again,…we're in our quote request management controller…and I'm going to start a new method…for my init binder.…And for this particular method,…it's okay to just go ahead and call it initBinder.…No need to get too creative with this method name.…One thing you have to do…is you have to have a WebDataBinder argument on this method…so let me add that now.…
And then I'll begin with a simple example…to show you why someone would use a method like this.…For our particular example,…we're just going to do some date formatting…and that's going to require me to create…
- Using Spring MVC for web projects
- Spring MVC controllers
- Creating controllers and views
- Spring MVC models
- Creating the model
- Request mapping
- Spring MVC views
- Custom app configuration
Skill Level Intermediate
1. Using Spring MVC for Web Projects
2. Spring MVC Controllers
3. Spring MVC Models
4. Spring MVC Views
5. Custom App Configuration
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.