没有注释的 Restful Web 服务? [英] Restful web service without annotations?

查看:32
本文介绍了没有注释的 Restful Web 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为现有 API 创建一个 Restful Web 服务,而无需向 POJO(Java 类)添加注释?球衣可以吗?还是其他 JAX-RS 实现?问题是我的类有太多注释,在处理复杂数据类型时需要添加一些适配器.

Is it possible to create a Restful webservice for an existing API without having to add annotations to POJOs (java classes)? Is it possible with jersey? or another JAX-RS implementation? The problem is that i am just having too much annotations on my classes and need to add some adapters when dealing with complex data types.

推荐答案

当然还有其他方法和库可用于发布不依赖于注释的 RESTful 资源,例如 Restlet.查看 JAX-RS 规范似乎它定义的只是注释.如果您不使用注释,您就不再使用 JAX-RS.

There are certainly other approaches and libraries for publishing RESTful resources that don't rely on annotations such as Restlet for instance. Looking at the JAX-RS specification it seems that all it defines are the annotations. If you don't use the annotations, you aren't using JAX-RS anymore.

这篇关于没有注释的 Restful Web 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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