Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
<mvc:annotation-driven /> doesn't allow CustomPropertyEditor be co-exists [SPR-7077] #11737
Although it is preferable to use conversionService rather than use the CustomEditor, in some situation, custom editor is still required (e.g. StringTrimmerEditor). The current AnnotationDrivenBeanDefinitionParser (used by MvcNamespaceHandler for <mvc:annotation-driven />) will create a ConfigurableWebBindingInitializer instance internally, which doesn't allow to register custom editors with propertyEditorRegistrars.
Affects: 3.0 GA, 3.0.1, 3.0.2
Reference URL: http://forum.springsource.org/showthread.php?t=84267
7 votes, 12 watchers
Chris Beams commented
Rossen, please see the linked forum issue as well as this new one recently submitted: http://forum.springsource.org/showthread.php?112734-Best-way-to-configer-StringTrimmerEditor-globally-using-Spring-3.1-with-Java-Config&p=373716
Rossen Stoyanchev commented
I've corrected the link to the sample above. See the JacksonConversionServiceConfigurer class but keep in mind you might have to check for a bean of instance RequestMappingHandlerAdapter rather than AnnotationMethodHandlerAdapter depending on which one you're actually using.
Canny Duck commented
This code unfortunately does not work. Any ideas?
public class DefaultBindingConfigurer implements BeanPostProcessor