SlideShare a Scribd company logo
RESTEa 简介
     asy
        By 李
           李伟男
  l.weinan@
          @gmail.com
       2011-10-27
议程
• 自我介绍
• 什么是REST?
  什么是
• JAX-RS介绍
  JAX RS介绍
• RESTEasy使用展示
             示
• RESTEasy功能介绍
             绍
• 参考资料
自我介绍
• JBoss Software En
                  ngineer since 2010
• RESTEasy Produc ctization Lead
• JBoss EWS Produ uctization Lead
• JBoss EAP 6 Prodductization Team
  Member
• cocoa / lisp / reverrse engineering / ror ...
• http://weibo.com/b bluedash
团队介绍

• 产品化团队北京Te
          eam:杨泳,王卉,高
  林,李伟男
• Team Leader: Fernando Nasser
  (Toronto Office)
•M
 Manager: B
          Bruno Georges
什么是
        是REST


• REpresentationa State Transfer
                al
 • PhD by Roy Fiielding
的目标
    REST的


• 让开发者像用户使用
          用浏览器看网页一样
 方便,简单地使用W
  便 简单 使 WebService接口。
                   接
REST达成目标使用的
     方法
• 一套架构标准,特别是对接 地址设计
   套架构标准 特别是对接口地址设计
 的指导意见。
 的指导意见
• REST 并未规定所使
            使用的网络协议,但
            使用的网络协议 但
 一般用于HTTP协议
         协议之下。
• REST针对HTTP协
            协议的URL地址设计及
 数据交换提供了具体的说明。
JAX RS
           X
           X-RS
• JCP标准
      标准
• JSR-311
• Java EE6 的组成部 部分
• 基于Annotation的框框架
• HTTP request 映射
                射至Java methods
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {

•       @Path(“/{order-id}”)

•       @GET

•       @Produces( application/xml )
        @Produces(“application/xml”)

•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …

•       }

•   }
JAX RS
JAX-RS Annotations
•   @Path
    •   定义对应的URI路
                路径
•   @Produces, @Con
                  nsumes
    •   定义接受与返回的
               的数据MIME类型
•   @GET, @POST, @
                 @DELETE, @PUT,
    @HEAD
    •   定义对应的HTTP方法
        定义对应的
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {
                                                          对应的基础URI
•       @Path(“/{order-id}”)

•       @GET

•       @Produces( application/xml )
        @Produces(“application/xml”)

•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …

•       }

•   }
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {
                                                          getOrder()方法对应
•       @Path(“/{order-id}”)                              的进一步路径。

•       @GET

•       @Produces( application/xml )
        @Produces(“application/xml”)

•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …

•       }

•   }
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {

•       @Path(“/{order-id}”)                              参数映射

•       @GET

•       @Produces( application/xml )
        @Produces(“application/xml”)
                                                          数据类型自动
                                                          转换
•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …

•       }

•   }
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {

•       @Path(“/{order-id}”)
                                        对应的
                                        对应的HTTP方
                                               方
•       @GET                            法

•       @Produces( application/xml )
        @Produces(“application/xml”)

•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …

•       }

•   }
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {

•       @Path(“/{order-id}”)
                                        定义返回的数
•       @GET                            据类型

•       @Produces( application/xml )
        @Produces(“application/xml”)

•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …

•       }

•   }
JAX RS GET
                     S:
•
               /orders/3323
               / d s/3323
    @Path(“/orders”)

•   public class OrderResource {

•       @Path(“/{order-id}”)

•       @GET

•       @Produces( application/xml )
        @Produces(“application/xml”)

•       Order getOrder(@PathParam(“or
                                    rder-id”) int id) {

•       …
                                     由Coontent
•       }                            Hand
                                        dler负责数据
                                     类型的转换。

•   }
RESTEa
               asy功能
•   可嵌入
•   CDI Spring EJB, Guice, 及Seam
    CDI, Spring, EJB Guice     m集成
•   客户端框架
•   支持异步HTTP (COMET)
•   Asynchronous Jobs
•   客户端及服务器的缓存方案
•   Interceptor
•   自动GZIP压缩及解压
•   可扩展的数据交换格式
•   可扩展的HTTP Method支持
•   ...
参考资料
•   http://www.jboss.org/res
                           steasy
•   http://bluedash.net/sear
                           rch/resteasy
•   http://bluedash.net/sear h/jb
    htt //bl d h t/        rch/jboss
•   http://bluedash.net/spac
    http://bluedash net/spac
                           ces/JBoss%20AS7中的新概
    念-域
•   http://bluedash.net/spac
                           ces/JBoss%20AS%207%20
    快速上手
•   http://bluedash.net/spac
       p                 p ces/Arquillian%20-
                                 q
    %20JBoss的测试利器
谢谢!
 谢

More Related Content

PDF
Go语言web开发
PPTX
FHIR Server 安裝與使用
PPTX
Mongo db 特性
PPTX
Mongo db 簡介
PDF
Guvnor presentation jervis liu
PDF
As7 jbug j_boss_modules_yang yong
PDF
20 Creative Sustainable Packaging Design Examples
PDF
Essential things that should always be in your car
Go语言web开发
FHIR Server 安裝與使用
Mongo db 特性
Mongo db 簡介
Guvnor presentation jervis liu
As7 jbug j_boss_modules_yang yong
20 Creative Sustainable Packaging Design Examples
Essential things that should always be in your car

Similar to Jbug beijing 2011 rest easy introduction [兼容模式] (16)

PDF
用JAX-RS和Jersey完成RESTful Web Services
PPT
Rest Ruby On Rails
PPT
Rest与面向资源的web开发
PDF
J2ee经典学习笔记
PPT
Intro to rest
PPT
Intro to REST
PDF
廖雪峰 Saa s ovp
PDF
运维系统开发与Rails 3页面开发实践
PPTX
開放原始碼 Ch2.5 app - oss - 3rd party api(ver 1.0)
PPT
Exodus2 大局观
PPT
Exodus重构和向apollo迁移
PDF
4. Go 工程化实践-0124-v2.pdf
ODP
RESTful
PPTX
使用JSR311规范快速的构建REST应用
PDF
REST & SOA
PPTX
Web development introduced history and future
用JAX-RS和Jersey完成RESTful Web Services
Rest Ruby On Rails
Rest与面向资源的web开发
J2ee经典学习笔记
Intro to rest
Intro to REST
廖雪峰 Saa s ovp
运维系统开发与Rails 3页面开发实践
開放原始碼 Ch2.5 app - oss - 3rd party api(ver 1.0)
Exodus2 大局观
Exodus重构和向apollo迁移
4. Go 工程化实践-0124-v2.pdf
RESTful
使用JSR311规范快速的构建REST应用
REST & SOA
Web development introduced history and future
Ad

Recently uploaded (20)

PPTX
3分钟读懂皇家艺术学院毕业证RCA毕业证学历认证
PPTX
3分钟读懂贝尔法斯特女王大学毕业证QUB毕业证学历认证
PPTX
3分钟读懂肯塔基大学毕业证UK毕业证学历认证
PPTX
3分钟读懂加州大学欧文分校毕业证UCI毕业证学历认证
PPTX
3分钟读懂曼彻斯特城市大学毕业证MMU毕业证学历认证
PPTX
3分钟读懂渥太华大学毕业证UO毕业证学历认证
PPTX
3分钟读懂圣安德鲁斯大学毕业证StAnd毕业证学历认证
PPTX
3分钟读懂伦敦南岸大学毕业证LSBU毕业证学历认证
PPTX
3分钟读懂伦敦政治经济学院毕业证LSE毕业证学历认证
PDF
想要安全提高成绩?我们的黑客技术采用深度伪装和多层加密手段,确保你的信息安全无忧。价格公道,流程简单,同时提供全面的信息保护和事后痕迹清理,让你轻松提升G...
PPTX
3分钟读懂纽曼大学毕业证Newman毕业证学历认证
PPTX
3分钟读懂索尔福德大学毕业证Salford毕业证学历认证
PDF
黑客出手,分数我有!安全可靠的技术支持,让你的GPA瞬间提升,留学之路更加顺畅!【微信:viphuzhao】
PPTX
3分钟读懂诺里奇艺术大学毕业证NUA毕业证学历认证
PPTX
A Digital Transformation Methodology.pptx
PDF
黑客技术,安全提分不是梦!我们采用最新的数据破解和隐藏技术,精准定位并修改你的成绩,同时采用深度隐藏技术确保你的操作不被发现。价格实惠,流程快速,事后无痕...
PPTX
3分钟读懂南威尔士大学毕业证UCB毕业证学历认证
PPTX
模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板
PPTX
3分钟读懂贵湖大学毕业证U of G毕业证学历认证
PDF
01_Course_Introduction(20210916課後更新).pdf
3分钟读懂皇家艺术学院毕业证RCA毕业证学历认证
3分钟读懂贝尔法斯特女王大学毕业证QUB毕业证学历认证
3分钟读懂肯塔基大学毕业证UK毕业证学历认证
3分钟读懂加州大学欧文分校毕业证UCI毕业证学历认证
3分钟读懂曼彻斯特城市大学毕业证MMU毕业证学历认证
3分钟读懂渥太华大学毕业证UO毕业证学历认证
3分钟读懂圣安德鲁斯大学毕业证StAnd毕业证学历认证
3分钟读懂伦敦南岸大学毕业证LSBU毕业证学历认证
3分钟读懂伦敦政治经济学院毕业证LSE毕业证学历认证
想要安全提高成绩?我们的黑客技术采用深度伪装和多层加密手段,确保你的信息安全无忧。价格公道,流程简单,同时提供全面的信息保护和事后痕迹清理,让你轻松提升G...
3分钟读懂纽曼大学毕业证Newman毕业证学历认证
3分钟读懂索尔福德大学毕业证Salford毕业证学历认证
黑客出手,分数我有!安全可靠的技术支持,让你的GPA瞬间提升,留学之路更加顺畅!【微信:viphuzhao】
3分钟读懂诺里奇艺术大学毕业证NUA毕业证学历认证
A Digital Transformation Methodology.pptx
黑客技术,安全提分不是梦!我们采用最新的数据破解和隐藏技术,精准定位并修改你的成绩,同时采用深度隐藏技术确保你的操作不被发现。价格实惠,流程快速,事后无痕...
3分钟读懂南威尔士大学毕业证UCB毕业证学历认证
模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板
3分钟读懂贵湖大学毕业证U of G毕业证学历认证
01_Course_Introduction(20210916課後更新).pdf
Ad

Jbug beijing 2011 rest easy introduction [兼容模式]

  • 1. RESTEa 简介 asy By 李 李伟男 l.weinan@ @gmail.com 2011-10-27
  • 2. 议程 • 自我介绍 • 什么是REST? 什么是 • JAX-RS介绍 JAX RS介绍 • RESTEasy使用展示 示 • RESTEasy功能介绍 绍 • 参考资料
  • 3. 自我介绍 • JBoss Software En ngineer since 2010 • RESTEasy Produc ctization Lead • JBoss EWS Produ uctization Lead • JBoss EAP 6 Prodductization Team Member • cocoa / lisp / reverrse engineering / ror ... • http://weibo.com/b bluedash
  • 4. 团队介绍 • 产品化团队北京Te eam:杨泳,王卉,高 林,李伟男 • Team Leader: Fernando Nasser (Toronto Office) •M Manager: B Bruno Georges
  • 5. 什么是 是REST • REpresentationa State Transfer al • PhD by Roy Fiielding
  • 6. 的目标 REST的 • 让开发者像用户使用 用浏览器看网页一样 方便,简单地使用W 便 简单 使 WebService接口。 接
  • 7. REST达成目标使用的 方法 • 一套架构标准,特别是对接 地址设计 套架构标准 特别是对接口地址设计 的指导意见。 的指导意见 • REST 并未规定所使 使用的网络协议,但 使用的网络协议 但 一般用于HTTP协议 协议之下。 • REST针对HTTP协 协议的URL地址设计及 数据交换提供了具体的说明。
  • 8. JAX RS X X-RS • JCP标准 标准 • JSR-311 • Java EE6 的组成部 部分 • 基于Annotation的框框架 • HTTP request 映射 射至Java methods
  • 9. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { • @Path(“/{order-id}”) • @GET • @Produces( application/xml ) @Produces(“application/xml”) • Order getOrder(@PathParam(“or rder-id”) int id) { • … • } • }
  • 10. JAX RS JAX-RS Annotations • @Path • 定义对应的URI路 路径 • @Produces, @Con nsumes • 定义接受与返回的 的数据MIME类型 • @GET, @POST, @ @DELETE, @PUT, @HEAD • 定义对应的HTTP方法 定义对应的
  • 11. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { 对应的基础URI • @Path(“/{order-id}”) • @GET • @Produces( application/xml ) @Produces(“application/xml”) • Order getOrder(@PathParam(“or rder-id”) int id) { • … • } • }
  • 12. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { getOrder()方法对应 • @Path(“/{order-id}”) 的进一步路径。 • @GET • @Produces( application/xml ) @Produces(“application/xml”) • Order getOrder(@PathParam(“or rder-id”) int id) { • … • } • }
  • 13. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { • @Path(“/{order-id}”) 参数映射 • @GET • @Produces( application/xml ) @Produces(“application/xml”) 数据类型自动 转换 • Order getOrder(@PathParam(“or rder-id”) int id) { • … • } • }
  • 14. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { • @Path(“/{order-id}”) 对应的 对应的HTTP方 方 • @GET 法 • @Produces( application/xml ) @Produces(“application/xml”) • Order getOrder(@PathParam(“or rder-id”) int id) { • … • } • }
  • 15. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { • @Path(“/{order-id}”) 定义返回的数 • @GET 据类型 • @Produces( application/xml ) @Produces(“application/xml”) • Order getOrder(@PathParam(“or rder-id”) int id) { • … • } • }
  • 16. JAX RS GET S: • /orders/3323 / d s/3323 @Path(“/orders”) • public class OrderResource { • @Path(“/{order-id}”) • @GET • @Produces( application/xml ) @Produces(“application/xml”) • Order getOrder(@PathParam(“or rder-id”) int id) { • … 由Coontent • } Hand dler负责数据 类型的转换。 • }
  • 17. RESTEa asy功能 • 可嵌入 • CDI Spring EJB, Guice, 及Seam CDI, Spring, EJB Guice m集成 • 客户端框架 • 支持异步HTTP (COMET) • Asynchronous Jobs • 客户端及服务器的缓存方案 • Interceptor • 自动GZIP压缩及解压 • 可扩展的数据交换格式 • 可扩展的HTTP Method支持 • ...
  • 18. 参考资料 • http://www.jboss.org/res steasy • http://bluedash.net/sear rch/resteasy • http://bluedash.net/sear h/jb htt //bl d h t/ rch/jboss • http://bluedash.net/spac http://bluedash net/spac ces/JBoss%20AS7中的新概 念-域 • http://bluedash.net/spac ces/JBoss%20AS%207%20 快速上手 • http://bluedash.net/spac p p ces/Arquillian%20- q %20JBoss的测试利器