java 在 Tomcat 中通过 JAX-RS/CXF 使用 RESTful 服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3947805/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 04:05:06  来源:igfitidea点击:

Using RESTful services with JAX-RS/CXF in Tomcat

javaresttomcatcxfjax-rs

提问by Luke

I'm interested in using Apache's JAX-RS implementation (CXF) in a Tomcat environment. The documentationis pretty clear and straight forward about developing a RESTful service with JAX-RS/CXF. However, I'm not sure how to develop a JAX-RS service within the context of a Tomcat environment.

我对在 Tomcat 环境中使用 Apache 的 JAX-RS 实现 (CXF) 感兴趣。关于使用 JAX-RS/CXF 开发 RESTful 服务的文档非常清晰和直接。但是,我不确定如何在 Tomcat 环境的上下文中开发 JAX-RS 服务。

Does anyone know of a good tutorial on developing JAX-RS/CXF services for Tomcat?

有谁知道为 Tomcat 开发 JAX-RS/CXF 服务的好教程?

回答by Riccardo Cossu

Not exactly a tutorial, but there is nothing special in developing JAX-RS in Tomcat (after all it is based on the servlet specification, which tomcat supports):

不完全是教程,但在 Tomcat 中开发 JAX-RS 并没有什么特别之处(毕竟它是基于 servlet 规范的,tomcat 支持):

http://cxf.apache.org/docs/jaxrs-services-configuration.html

http://cxf.apache.org/docs/jaxrs-services-configuration.html

(in particular under the heading Configuring JAX-RS services in container without Spring)

(特别是在没有 Spring 的容器中配置 JAX-RS 服务的标题下)

回答by ben rhouma moez

There is a tutorial how to developing a resful services with jax-rs/cxf in tomcat: http://javajeedevelopment.blogspot.fr/2014/07/restful-services-using-apache-cxf.html

有一个教程如何在 tomcat 中使用 jax-rs/cxf 开发 resful 服务:http://javajeedevelopment.blogspot.fr/2014/07/restful-services-using-apache-cxf.html