With @EnableHypermediaSupport(type = HypermediaType.HAL)
Spring hateoas provides a simple and convenient way to enable HAL rendering.
The annotations triggers some configuration magic which is explained here: https://github.com/spring-projects/spring-hateoas#enablehypermediasupport
However if you are working on a given xml-config based spring application, it is not easy to integrate @EnableHypermediaSupport. I tried a lot of different ways to enable HAL rendering but no single solution was working correctly:
- Including a configuration class in existing mvc servlet xml configuration.
- Using different versions of spring hateos (0.70.0, 0.80.0, 0.9.0.BUILD-SNAPSHOT), hoping that 0.90.0 will produce HAL out of the box, since, according to a jira issue, it should become the default rendering (at least for spring data rest).
- Using a custom
MappingJackson2HttpMessageConverter
to register anew Jackson2HalModule()
also did not work. Although the converter was used for rendering (for example to render Dates), the output was not rendered in HAL.
Therefore my question: How can I enable HAL rendering without using EnableHypermediaSupport?
I intentionally left out any code snippets, because I don't think that it would help much.
@EnableHypermediaSupport
? – Sadiras