While I was debugging my Spring Boot application I noticed that methods annotated with @InitBinder
are invoked for every incoming request.
@InitBinder("categories")
public void bindFields(WebDataBinder binder) {
binder.registerCustomEditor(Set.class, new CustomPropertyEditor());
}
In @InitBinder
methods we are setting a PropertyEditor
to a binder. I can't understand why should these methods be called again and again and set the same thing?
Does Spring create a new WebDataBinder
object for every single request?