ALPS metadata for all Spring-MVC Controller

吃可爱长大的小学妹 提交于 2019-12-10 12:46:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!