所有 Spring-MVC 控制器的 ALPS 元数据 [英] ALPS metadata for all Spring-MVC Controller

查看:36
本文介绍了所有 Spring-MVC 控制器的 ALPS 元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 spring hatoas/data rest 中的 ALPS 支持的问题.似乎只有在您拥有 Spring 数据休息存储库时才会公开 ALPS 元数据.所以我的问题是为什么只支持 spring 数据休息存储库,我可以为所有 spring mvc 控制器启用它吗?是否有任何示例可以公开所有控制器的 ALPS 元数据?

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?

可能我没理解 ALPS 的概念...

Maybe I haven't understood the conept of ALPS...

问候

Meleagros

http://spring.io/blog/2014/07/14/spring-data-rest-now-comes-with-alps-metadata

推荐答案

这只是部分回答了问题,但 Oliver Gierke 在上面链接的博客文章的评论中回答了以下问题:

This only partially answers the question, but Oliver Gierke answered the following in the comments on the blog post linked above:

因为它依赖于您公开的链接类型的知识,您如何命名它们以及支持哪些 HTTP 方法.用朴素的Spring MVC 应用所有这一切都不受框架的控制,因此我们无法提供开箱即用的服务.

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.

但是,Spring HATEOAS 包含用于编写自定义 Alps 描述符的 API以便您可以公开描述您的其他元数据手动控制器.

However, Spring HATEOAS contains API to write custom Alps descriptors so that you can expose additional metadata that describe your controllers manually.

这篇关于所有 Spring-MVC 控制器的 ALPS 元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆