无注释RESTful Web服务? [英] Restful web service without annotations?
问题描述
是否有可能为现有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.
推荐答案
有一定发布不依赖于注解,如的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屋!