public class DomainClassPropertyEditorRegistrar extends Object implements PropertyEditorRegistrar, ApplicationContextAware
PropertyEditors for domain classes. To get this
working configure a ConfigurableWebBindingInitializer for your
AnnotationMethodHandlerAdapter and register the
DomainClassPropertyEditorRegistrar there:
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer">
<property name="propertyEditorRegistrars">
<bean class="org.springframework.data.extensions.beans.DomainClassPropertyEditorRegistrar" />
</property>
</bean>
</property>
</bean>
Make sure this bean declaration is in the ApplicationContext created by the DispatcherServlet
whereas the repositories need to be declared in the root
WebApplicationContext.| Constructor and Description |
|---|
DomainClassPropertyEditorRegistrar() |
| Modifier and Type | Method and Description |
|---|---|
void |
registerCustomEditors(PropertyEditorRegistry registry) |
void |
setApplicationContext(ApplicationContext context) |
public void registerCustomEditors(PropertyEditorRegistry registry)
registerCustomEditors in interface PropertyEditorRegistrarpublic void setApplicationContext(ApplicationContext context)
setApplicationContext in interface ApplicationContextAwareCopyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.