is there any way to globally register common property editors, for all controllers? other way then creating base controller classes?
Printable View
is there any way to globally register common property editors, for all controllers? other way then creating base controller classes?
You can also register a customEditor at the applicationContext level by following the description there :
http://www.springframework.org/docs/...-customeditors
However, I'm not sure at 100% it gets propagated to the servlet property editors.
Have a try.
Olivier
it doesn't :(
ok, sorry
Still, instead of inheriting from a common controller, I suggest to have delegation and actually have an utility class with a static initBinder method which actually add your custom editors. This way, you're free to use inheritance for other purpose than a mere factorisation of property editor registration.
Actually, the auto registration of propertyEditor from applicationContext to controller could be an interesting feature.
Olivier