Your SlideShare is downloading. ×
Brief Intro To Jax Rs
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Brief Intro To Jax Rs

1,416

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,416
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. A Brief Introduction to JAX-RS Marc Hadley Sun Microsystems
  • 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. 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. 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. 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. *(question (answer | stumped))

×