这里要讲的是基于Apache CXF来创建RESTful Web Service。可以在Apache的网站下载到CXF的发行版本。Apache的官网是这样介绍CXF的:
Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.
下载完成后解压并找到lib目录,将其中的jar文件添加你的Java项目中,接下来就可以开始编写你的Web Service程序了。话不多说,直接上代码。
温馨提示:答案为网友推荐,仅供参考