-1-
JAX-RS JAX-RS Java API for RESTful Web Service JAX-RS REST Web API JAX-RS JCP JSR-311 JAX-RS https://jersey.dev.java.net/ Jersey JAX-RS RESTEasy 1RESTJAX-RSJerseyRESTEasy JersyRESTEasy JAX RS REST JAX-RS Java EE 6 Java EE JAX-RS Java J2SE 5.0-2-
RESTful Web RESTful Web REST Web REST REST Representational State Transfer REST Roy Thomas Fielding RESTful Web Amazon S3 Google App Engine RESTful App Engine RESTful Server RESTful Web SOAP Web HTTP Web RESTful Web () Web 10 RESTful Web URI Web URI Web URI RESTful Web URI http://www.mysystem.jp/foods/apple URI URI apple pear -3-
() RESTful Web RESTful Web REST 2 XXXX5,000 10,000 XXXX5,000 5,000 XXXX 10,000 XXXX 10,000 ATM 5,000 5,000 ATM ATM RESTful Web 1 1 HTTP RESTful Web RESTful Web -4-
Web () HTTP REST HTTP REST HTTP 1REST HTTP GET PUT POST DELETE HEAD OPTIONS HTTP REST HTTP HTTP REST HTTP () HTTP RESTful Web http://www.mysystem.jp/foods/ -5-
3 http://www.mysystem.jp/foods/ /foods/ <ahref="http://www.mysystem.jp/foods/apple">"</a> <ahref="http://www.mysystem.jp/foods/pear"></a> <ahref="http://www.mysystem.jp/foods/bread"></a> <ahref="http://www.mysystem.jp/foods/steak"></a> http://www.mysystem.jp/foods/bread /foods/bread foods URI Web -6-
JAX-RS RESTful Web JAX-RS Jersey RESTful Web NetBeans6.5.1 RESTful NetBeans http://ja.netbeans.org/netbeans Java Web EE NetBeans JAX-RS URI HTTP Java RESTful Web NetBeans 4 Hello World Java HelloWorldResource -7-
RESTful Web AP 5 RESTfull Web 6-8-
HTTP Java HTTP HTTP HTTP @ HTTP GET@GET 1HTTP @GET @Produces("text/html") public String getxml() { getxml URI GET @Produces URI URI @Path 2@Path @Path("/helloWorld") public class HelloWorldResource { HelloWorldResource /helloworld URI http://localhost:8080/helloworld/resources/helloworld @Path @Path @Path getxml @Path -9-
3 @GET @Path("subHello") @Produces("text/html") public String getxml() { REST 7-10-
@Produces 1 @Produces URI HTTP HTTP text/html getxml 8 8 helloworld : 406 (Not Acceptable) @Produces HTTP 406 @Produces 4 @Produces({"application/xml", "application/json"}) application/xml application/json -11-
@Consumes @Consumes @Produces @Produces 5@Consumes @PUT @Consumes("application/xml") public void putxml(string content) { application/xml String content @PathParam @Path @Path {customerid}/ @PathParam 6@PathParam @Path("{customerId}/") public CustomerResource getcustomerresource( @PathParam("customerId") Integer id) { customerid id -12-
@QueryParm URI 7 http://localhost:8080/helloworld/resources/helloworld?param=123 8 @QueryParam public String getxml(@queryparam( param ) int num) { @FormParam -13-
JAX-RS JAX-RS RESTful Web JAX-RS Jersey RESTful Web REST Web RESTful Web RESTful API REST Java RESTful Web PHP PerlRuby JAX-RS RESTful Web Java Java RESTful Web RESTful Web Leonard RichardsonSam Ruby ISBN978-4-87311-353-1 WEB+DB PRESS Vol.42 REST ISBN978-4-7741-3331-7 The Java Community Process(SM) Program - JSRs: Java Specification Requests - detail JSR# 311: URLhttp://jcp.org/en/jsr/detail?id=311 Architectural Styles and the Design of Network-based Software Architectures URLhttp://roy.gbiv.com/pubs/dissertation/top.htm RESTful Web - NetBeans IDE 6.5 : URLhttp://www.netbeans.org/kb/docs/websvc/rest_ja.html Studying HTTP URLhttp://www.studyinghttp.net/ -14-