RESTEasy
共 4 篇文章
RESTEasy +Jackson 2 进行JSON转换
**1. 整合RESTEasy和Jackson2 ** 需要引入resteasy-jackson-provider.jar 2.一个简单的Object package com.example.rest.resteasy.model; public class Customer { private int id; private String firstName; private String lastName; public int getId() { return id; } public void setId(int id) { this.id = id; } public String…
2013-06-27 22:04 · RESTEasy · json · resteasy
RESTEasy @PathParam 与正则表达式映射
不翻译了@PathParam is a parameter annotation which allows you to map variable URI path fragments into your method call. package com.example.rest.resteasy.service; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; @Path("/hello") public clas…
2013-06-26 11:25 · RESTEasy · resteasy
RESTEasy @path 与正则表达式映射
@path 不限于简单的路径表达式,也可以在@path中插入正则表达式,通过如下格式: "{" variable-name [ ":" regular-expression ] "}" package com.example.rest.resteasy.service; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.core.Response; @Path("/hello") public class HelloWorldRestService { // @Path and regular expres…
2013-06-26 10:52 · RESTEasy · Restful
RESTEasy 入门实例
[img]http://www.jboss.org/dms/resteasy/images/resteasy-banner-1180px.png[/img] [size=x-large][b]1. 在Eclipse中建立Maven工程[/b][/size] 1.1 新建Maven工程 [img]http://dl2.iteye.com/upload/attachment/0086/1865/a8d1e4a7-4845-3fc4-9ca4-adcd3010b43d.png[/img] 1.2 选择默认工作空间 [img]http://dl2.iteye.com/upload/attachmen…
2013-06-26 09:14 · RESTEasy · REST · maven