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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user