问题
I've a question about the ALPS support in spring hateoas/data rest. It seems that the ALPS metadata are only exposed if you have a spring data rest repository. So my question is why is there only a support for the spring data rest repository and can I enable it for all spring mvc controllers? Is there any example to expose the ALPS metadata for all controllers?
Maybe I haven't understood the conept of ALPS...
Greets
Meleagros
http://spring.io/blog/2014/07/14/spring-data-rest-now-comes-with-alps-metadata
回答1:
This only partially answers the question, but Oliver Gierke answered the following in the comments on the blog post linked above:
Because it relies on the knowledge of which kinds of links you expose, how you name them and which HTTP methods are supported. With a plain Spring MVC application all of this is out of control of the framework, hence we can't provide it out-of-the-box.
However, Spring HATEOAS contains API to write custom Alps descriptors so that you can expose additional metadata that describe your controllers manually.
来源:https://stackoverflow.com/questions/25469923/alps-metadata-for-all-spring-mvc-controller