3. JSR311(JAX-RS)项目介绍 JSR311 正式称呼 JAX-RS:Java API for RESTful Web Services JSR311是Sun在2007年2月发布的一个基于annotation的API JSR311项目地址https://jsr311.dev.java.net/ 版本: jsr311-1.0(稳定版)已经通过了JCP的投票同意 jsr311-1.1(草稿版)
4. JAX-RS的特性 提供annotation的API规范 提出WADL(Web Application Description Language)规范来描述REST应用 https://wadl.dev.java.net JSR-311 提供一组注释,相关类和接口都可以用来将Java 对象作为 Web 资源展示。该规范假定 HTTP 是底层网络协议。 它使用注释提供 URI 和相应资源类之间的清晰映射,以及 HTTP 方法与 Java 对象方法之间的映射。 API 支持广泛的 HTTP 实体内容类型,包括 HTML、XML、JSON、GIF、JPG 等。 它还将提供所需的插件功能,以允许使用标准方法通过应用程序添加其他类型。
8. Restlet介绍 项目地址 http://www.restlet.org http://www.noelios.com/ Restlet可以说是最早的REST框架,JAX-RS规范出来之前,它就已经存在了。 Restlet是在Servlet的之上发展的这套框架 http://www.restlet.org/about/introduction Restlet并不是完全按照JAX-RS规范来实现 Restlet有自己的一套API 稳定版本1.1.5,jax-rs 1.0的实现 最新版本2.0-m4,jax-rs 1.0的实现 特性: http://www.restlet.org/about/features Native REST support Available editions Complete Web Server Available Connectors Available Representations Flexible configuration Security Scalability Upcoming features
9. Jersey介绍 项目地址: https://jersey.dev.java.net Jersey是Sun提供的实现参考。由JAX-RS项目的成员来实现。 从某种意义上说,最符合JAX-RS规范 Jersey项目名称的来由:由于Jersey项目的主管非常喜欢自行车运动,而且当时正是环法自行车赛期间,所以起了这个名称。同时也透露出对Jersey这个项目的期望。 稳定版本为1.0.3,jax-rs1.0的实现 最新版本1.1.2-ea,jax-rs1.1的实现 特性: 提供Client,Service/Grizzly,WADL&JSON Test Framework Spring integration Guice integration MIME multipart Client & Apache HTTP Client Atom & Apache Abdera Simple HTTP server Oautch support
10. RESTEasy介绍 项目地址: http://www.jboss.org/resteasy/ RESTEasy是有JBOSS提供的实现。 顾名思义,这个项目的初衷就是如何更好的让使用者很方便容易的创建REST应用 最新稳定版本为1.1.GA,jax-rs 1.0的实现 特性: Fully certified JAX-RS implementation Portable to any app-server/Tomcat that runs on JDK 5 or higher Embeddedable server implementation for junit testing Client framework that leverages JAX-RS annotations so that you can write HTTP clients easily (JAX-RS only defines server bindings) Client "Browser" cache. Supports HTTP 1.1 caching semantics including cache revalidation Server in-memory cache. Local response cache. Automatically handles ETag generation and cache revalidation Rich set of providers for: XML, JSON, YAML, Fastinfoset, Multipart, XOP, Atom, etc. JAXB marshalling into XML, JSON, Jackson, Fastinfoset, and Atom as well as wrappers for maps, arrays, lists, and sets of JAXB Objects. GZIP content-encoding. Automatic GZIP compression/decompression suppport in client and server frameworks Asynchronous HTTP (Comet) abstractions for JBoss Web, Tomcat 6, and Servlet 3.0 Asynchronous Job Service. Rich interceptor model. EJB, Seam, Guice, Spring, and Spring MVC integration