From f21e150692ae836dadaf3bdc983f50caa289d3e6 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 9 Jun 2016 17:43:36 +0200 Subject: [PATCH] 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. --- .../data/rest/webmvc/config/RepositoryRestMvcConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java index 1d04b567f..6209d1347 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java @@ -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());