Is there a way that I can configure a WebBindingInitializer for a bean in Spring XML? I can configure the binder easily using the @InitBinder command, and then settings whatever state I want on it (typically this involves setting up a validator).
An example would be…
<bean id="fooController" class="com.foobar.controller.FooController">
<property name="binder" ref="globalBinder" />
<bean/>
Where the reference is too a WebBindingInitializer that has global properties.
Not sure if this exactly meets your needs, but you can create your own WebBindingInitializer that will allow you to externalize the initialization of the WebDataBinder used by your application. See the Spring Documenation for specifics on how you setup the configuation. This technique will allow you to reuse your databinding initialization code, rather than implement it in every Controller class.