Brief Intro To Jax Rs

1,632 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,632
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Brief Intro To Jax Rs

  1. 1. A Brief Introduction to JAX-RS Marc Hadley Sun Microsystems
  2. 2. HEAD /JAX-RS Java API for RESTful Web Services ● Annotation-based server-side API ● HTTP centric ● Server-side only ● Servlet or SE deployment ●
  3. 3. GET /JAX-RS/Examples/Resource @Path(quot;widgets/{id}quot;) @Produces(quot;application/widgets+xmlquot;) @Consumes(quot;application/widgets+xmlquot;) public class WidgetResource { private Widget w; public WidgetResource(@PathParam(quot;idquot;) String id) { this.w = locateRecord(id); } @GET Widget getWidget() { return w; } @PUT Widget updateWidget(Widget update) { w = processUpdate(update); return w; } }
  4. 4. GET /JAX-RS/Examples/Writer @Provider @Produces(quot;application/widgets+xmlquot;) public class WidgetWriter implements MessageBodyWriter<Widget> { public boolean isWriteable(...) {...} public long getSize(...) {...} public void writeTo(...) {...} }
  5. 5. GET /JAX-RS/Status 1.0 finalized end of September 2008 ● Online spec and API: ● https://jsr311.dev.java.net/nonav/releases/1.0/spec/index.html – https://jsr311.dev.java.net/nonav/releases/1.0/index.html – 1.1 maintenance release in progress focussing ● on integration with new Java EE 6 features Five open-source implementations already ● Jersey, JBoss RESTEasy, Restlet, Apache CXF, ● Triaxrs
  6. 6. *(question (answer | stumped))

×