DATAREST-840 - HalHandlerInstantiator now gets BeanFactory forwarded.

We now forward the AutowireCapableBeanFactory contained in the ApplicationContext to the HalHandlerInstantiator to make sure Jackson components can use dependency injection to access Spring managed beans.

Upgraded to Spring HATEOAS 0.21 snapshots to see the changes necessary in HalHandlerInstantiator.

Related ticket: spring-projects/spring-hateoas#460.
This commit is contained in:
Oliver Gierke
2016-06-09 17:43:36 +02:00
parent f2f9564882
commit f21e150692

View File

@@ -503,7 +503,7 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon
RelProvider defaultedRelProvider = this.relProvider != null ? this.relProvider : new EvoInflectorRelProvider();
HalHandlerInstantiator instantiator = new HalHandlerInstantiator(defaultedRelProvider, curieProvider,
resourceDescriptionMessageSourceAccessor());
resourceDescriptionMessageSourceAccessor(), applicationContext.getAutowireCapableBeanFactory());
ObjectMapper mapper = basicObjectMapper();
mapper.registerModule(persistentEntityJackson2Module());