SlideShare a Scribd company logo
Sabyasachi Ghosh, Senior Application Engneer Oracle India, @neilghosh Developing RESTful Web services with JAX-RS
Java API for RESTful Web Services (JAX-RS) Standard annotation-driven API that aims to help developers build RESTful Web services in Java
RESTful Application Cycle Resources are identified by URIs ↓ Clients communicate with resources via requests using a standard set of methods ↓ Requests and responses contain resource representations in formats identified by media types ↓ Responses contain URIs that link to further resources
Give everything an ID
Standard set of methods
Link things together
Multiple representations
Stateless communications
ID is a URI http://example.com/widgets/foo http://example.com/customers/bar http://example.com/customers/bar/orders/2 http://example.com/orders/101230/customer
Resources are identified by URIs Resource == Java class POJO
No required interfaces ID provided by  @Path  annotation Value is relative URI, base URI is provided by deployment context or parent resource
Embedded parameters for non-fixed parts of the URI
Annotate class or “sub-resource locator” method
Resources are identified by URIs @Path("orders/{order_id}") public class OrderResource {   @GET  @Path("customer") CustomerResource getCustomer( @PathParam(“order_id”)int id ) {...} }
Standard Set of Methods Purpose Method Remove DELETE Update or create with a known ID PUT Update or create without a known ID POST Read, possibly cached GET
Standard Set of Methods Annotate resource class methods with standard method @GET ,  @PUT ,  @POST ,  @DELETE ,  @HEAD
@HttpMethod  meta-annotation allows extensions, e.g. WebDAV JAX-RS routes request to appropriate resource class and method
Flexible method signatures, annotations on parameters specify mapping from request
Return value mapped to response
Standard Set of Methods @Path("properties/ {name} ") public class SystemProperty { @GET Property get(@PathParam(" name ") String name) {...} @PUT Property set(@PathParam(" name ") String name, String value ) {...} }
Parameters Template parameters and Regular expressions @Path("customers/ {firstname}-{lastname} ") @Path(" { id : \\d+} ") Matrix Parameters example.cars.com/mercedes/e55;color=black/2006 Query Paremetsrs DELETE /orders/233?cancel=true
Multiple Representations Offer data in a variety of formats XML
JSON
(X)HTML Maximize reach
Support content negotiation Accept header GET /foo Accept: application/json
URI-based GET /foo.json
Content Negotiation: Accept Header Accept: application/xml Accept: application/json;q=1.0, text/xml;q=0.5, application/xml;q=0.5, @GET @Produces({"application/xml","application/json"}) Order getOrder(@PathParam(" order_id ") String id) { ... } @GET @Produces("text/plain") String getOrder2(@PathParam("order_id") String id) { ... }
Content Negotiation: URL-based @Path("/orders") public class OrderResource { @Path("{orderId}.xml")    @Produces(“application/xml”)   @GET    public Order getOrderInXML(@PathParam("orderId") String orderId) { . . .   } @Path("{orderId}.json")    @Produces(“application/json”)   @GET   public Order getOrderInJSON(@PathParam("orderId") String orderId) { . . .   } }
Content Negotiation import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.PathParam; @Path("/actor/{id}") @GET @Produces("application/json") @PathParam("id") import javax.inject.Inject; import javax.enterprise.context.RequestScoped; @RequestScoped public class ActorResource { @Inject DatbaseBean db; public Actor getActor(  int id) { return db.findActorById(id); } }
Link Things Together <order self=&quot; http://example.com/orders/101230 &quot;> <customer ref=&quot; http://example.com/customers/bar &quot;> <product ref=&quot; http://example.com/products/21034 &quot;/> <amount value=&quot;1&quot;/> </order>
Responses Contain Links HTTP/1.1 201 Created Date: Wed, 03 Jun 2009 16:41:58 GMT Server: Apache/1.3.6 Location:  http://example.com/properties/foo Content-Type: application/order+xml Content-Length: 184 <property self=&quot; http://example.com/properties/foo &quot;> <parent ref=&quot; http://example.com/properties/bar &quot;/> <name>Foo</name> <value>1</value> </order>

More Related Content

What's hot (18)

PPT
Developing RESTful WebServices using Jersey
b_kathir
 
PPTX
Overview of RESTful web services
nbuddharaju
 
PDF
Jersey and JAX-RS
Eduardo Pelegri-Llopart
 
PDF
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
Arun Gupta
 
PPT
Introduction to JAX-RS
Andreas Bjärlestam
 
PDF
Java Web Programming [2/9] : Servlet Basic
IMC Institute
 
PDF
Json to hive_schema_generator
Payal Jain
 
PDF
OAuth: Trust Issues
Lorna Mitchell
 
PPTX
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 
PPTX
RESTful Web Services
Martin Necasky
 
PDF
JAX RS 2.0 - OTN Bangalore 2013
Jagadish Prasath
 
PPT
JSP Standart Tag Lİbrary - JSTL
seleciii44
 
PPTX
jstl ( jsp standard tag library )
Adarsh Patel
 
PDF
Csajsp Chapter5
Adil Jafri
 
DOC
Servlet basics
Santosh Dhoundiyal
 
PDF
RESTEasy
Massimiliano Dessì
 
PPT
The RESTful Soa Datagrid with Oracle
Emiliano Pecis
 
PPTX
JSP- JAVA SERVER PAGES
Yoga Raja
 
Developing RESTful WebServices using Jersey
b_kathir
 
Overview of RESTful web services
nbuddharaju
 
Jersey and JAX-RS
Eduardo Pelegri-Llopart
 
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
Arun Gupta
 
Introduction to JAX-RS
Andreas Bjärlestam
 
Java Web Programming [2/9] : Servlet Basic
IMC Institute
 
Json to hive_schema_generator
Payal Jain
 
OAuth: Trust Issues
Lorna Mitchell
 
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 
RESTful Web Services
Martin Necasky
 
JAX RS 2.0 - OTN Bangalore 2013
Jagadish Prasath
 
JSP Standart Tag Lİbrary - JSTL
seleciii44
 
jstl ( jsp standard tag library )
Adarsh Patel
 
Csajsp Chapter5
Adil Jafri
 
Servlet basics
Santosh Dhoundiyal
 
The RESTful Soa Datagrid with Oracle
Emiliano Pecis
 
JSP- JAVA SERVER PAGES
Yoga Raja
 

Viewers also liked (6)

ODT
Web Services JAX-RS RESTful y SOAP
ismaelmartincolmenarejo
 
PDF
Making Java REST with JAX-RS 2.0
Dmytro Chyzhykov
 
PPSX
JSR 339 - Java API for RESTful Web Services
Daniel Cunha
 
PDF
Easy REST APIs with Jersey and RestyGWT
David Chandler
 
PPTX
REST API Design for JAX-RS And Jersey
Stormpath
 
PDF
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
Web Services JAX-RS RESTful y SOAP
ismaelmartincolmenarejo
 
Making Java REST with JAX-RS 2.0
Dmytro Chyzhykov
 
JSR 339 - Java API for RESTful Web Services
Daniel Cunha
 
Easy REST APIs with Jersey and RestyGWT
David Chandler
 
REST API Design for JAX-RS And Jersey
Stormpath
 
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
Ad

Similar to RestFull Webservices with JAX-RS (20)

PDF
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Arun Gupta
 
PDF
JAX-RS JavaOne Hyderabad, India 2011
Shreedhar Ganapathy
 
PPTX
Rest
Carol McDonald
 
PPTX
Ppt on web development and this has all details
gogijoshiajmer
 
PPTX
JAX-RS. Developing RESTful APIs with Java
Jerry Kurian
 
PPT
ReST-ful Resource Management
Joe Davis
 
PDF
JAX-RS Creating RESTFul services
Ludovic Champenois
 
PPT
Web services - REST and SOAP
Compare Infobase Limited
 
PDF
Lab swe-2013intro jax-rs
Aravindharamanan S
 
PDF
Building RESTful applications using Spring MVC
IndicThreads
 
PDF
Introduction to JAX-RS @ SIlicon Valley Code Camp 2010
Arun Gupta
 
PPTX
Building Restful Web Services with Java
Vassil Popovski
 
PPTX
6 Months Industrial Training in Spring Framework
Arcadian Learning
 
PDF
RESTful Java With JAX RS 1st Edition Bill Burke
rohismhmob88
 
PDF
Web Services, for DevDays Belfast
chrismcclelland
 
PPTX
JAX-RS 2.0 and OData
Anil Allewar
 
PDF
RESTful Java With JAX RS 1st Edition Bill Burke
jolokmertah
 
PPTX
RESTful application with JAX-RS and how to expose and test them
Kumaraswamy M
 
PPTX
Restful webservices
Luqman Shareef
 
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Arun Gupta
 
JAX-RS JavaOne Hyderabad, India 2011
Shreedhar Ganapathy
 
Ppt on web development and this has all details
gogijoshiajmer
 
JAX-RS. Developing RESTful APIs with Java
Jerry Kurian
 
ReST-ful Resource Management
Joe Davis
 
JAX-RS Creating RESTFul services
Ludovic Champenois
 
Web services - REST and SOAP
Compare Infobase Limited
 
Lab swe-2013intro jax-rs
Aravindharamanan S
 
Building RESTful applications using Spring MVC
IndicThreads
 
Introduction to JAX-RS @ SIlicon Valley Code Camp 2010
Arun Gupta
 
Building Restful Web Services with Java
Vassil Popovski
 
6 Months Industrial Training in Spring Framework
Arcadian Learning
 
RESTful Java With JAX RS 1st Edition Bill Burke
rohismhmob88
 
Web Services, for DevDays Belfast
chrismcclelland
 
JAX-RS 2.0 and OData
Anil Allewar
 
RESTful Java With JAX RS 1st Edition Bill Burke
jolokmertah
 
RESTful application with JAX-RS and how to expose and test them
Kumaraswamy M
 
Restful webservices
Luqman Shareef
 
Ad

More from Neil Ghosh (10)

PPTX
GOLD AG Report in IEEE Hyderabad AGM 2013
Neil Ghosh
 
PPTX
Introduction to JavaFx and HTML5
Neil Ghosh
 
PPTX
GOLD at IEEE Hyderabad SAGM 2012
Neil Ghosh
 
PPT
Astronomy at Pecha Kuch Night Hyderabad Volume 9
Neil Ghosh
 
PDF
Astro quiz
Neil Ghosh
 
PPTX
IEEE GOLD STEP
Neil Ghosh
 
PPT
Introduction to javaScript
Neil Ghosh
 
PPT
Intro to web services
Neil Ghosh
 
ODP
Creating REST Webservice With NetBeans
Neil Ghosh
 
PPT
Edited
Neil Ghosh
 
GOLD AG Report in IEEE Hyderabad AGM 2013
Neil Ghosh
 
Introduction to JavaFx and HTML5
Neil Ghosh
 
GOLD at IEEE Hyderabad SAGM 2012
Neil Ghosh
 
Astronomy at Pecha Kuch Night Hyderabad Volume 9
Neil Ghosh
 
Astro quiz
Neil Ghosh
 
IEEE GOLD STEP
Neil Ghosh
 
Introduction to javaScript
Neil Ghosh
 
Intro to web services
Neil Ghosh
 
Creating REST Webservice With NetBeans
Neil Ghosh
 
Edited
Neil Ghosh
 

Recently uploaded (20)

PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 

RestFull Webservices with JAX-RS

  • 1. Sabyasachi Ghosh, Senior Application Engneer Oracle India, @neilghosh Developing RESTful Web services with JAX-RS
  • 2. Java API for RESTful Web Services (JAX-RS) Standard annotation-driven API that aims to help developers build RESTful Web services in Java
  • 3. RESTful Application Cycle Resources are identified by URIs ↓ Clients communicate with resources via requests using a standard set of methods ↓ Requests and responses contain resource representations in formats identified by media types ↓ Responses contain URIs that link to further resources
  • 5. Standard set of methods
  • 9. ID is a URI http://example.com/widgets/foo http://example.com/customers/bar http://example.com/customers/bar/orders/2 http://example.com/orders/101230/customer
  • 10. Resources are identified by URIs Resource == Java class POJO
  • 11. No required interfaces ID provided by @Path annotation Value is relative URI, base URI is provided by deployment context or parent resource
  • 12. Embedded parameters for non-fixed parts of the URI
  • 13. Annotate class or “sub-resource locator” method
  • 14. Resources are identified by URIs @Path(&quot;orders/{order_id}&quot;) public class OrderResource { @GET @Path(&quot;customer&quot;) CustomerResource getCustomer( @PathParam(“order_id”)int id ) {...} }
  • 15. Standard Set of Methods Purpose Method Remove DELETE Update or create with a known ID PUT Update or create without a known ID POST Read, possibly cached GET
  • 16. Standard Set of Methods Annotate resource class methods with standard method @GET , @PUT , @POST , @DELETE , @HEAD
  • 17. @HttpMethod meta-annotation allows extensions, e.g. WebDAV JAX-RS routes request to appropriate resource class and method
  • 18. Flexible method signatures, annotations on parameters specify mapping from request
  • 19. Return value mapped to response
  • 20. Standard Set of Methods @Path(&quot;properties/ {name} &quot;) public class SystemProperty { @GET Property get(@PathParam(&quot; name &quot;) String name) {...} @PUT Property set(@PathParam(&quot; name &quot;) String name, String value ) {...} }
  • 21. Parameters Template parameters and Regular expressions @Path(&quot;customers/ {firstname}-{lastname} &quot;) @Path(&quot; { id : \\d+} &quot;) Matrix Parameters example.cars.com/mercedes/e55;color=black/2006 Query Paremetsrs DELETE /orders/233?cancel=true
  • 22. Multiple Representations Offer data in a variety of formats XML
  • 23. JSON
  • 25. Support content negotiation Accept header GET /foo Accept: application/json
  • 27. Content Negotiation: Accept Header Accept: application/xml Accept: application/json;q=1.0, text/xml;q=0.5, application/xml;q=0.5, @GET @Produces({&quot;application/xml&quot;,&quot;application/json&quot;}) Order getOrder(@PathParam(&quot; order_id &quot;) String id) { ... } @GET @Produces(&quot;text/plain&quot;) String getOrder2(@PathParam(&quot;order_id&quot;) String id) { ... }
  • 28. Content Negotiation: URL-based @Path(&quot;/orders&quot;) public class OrderResource { @Path(&quot;{orderId}.xml&quot;) @Produces(“application/xml”) @GET public Order getOrderInXML(@PathParam(&quot;orderId&quot;) String orderId) { . . . } @Path(&quot;{orderId}.json&quot;) @Produces(“application/json”) @GET public Order getOrderInJSON(@PathParam(&quot;orderId&quot;) String orderId) { . . . } }
  • 29. Content Negotiation import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.PathParam; @Path(&quot;/actor/{id}&quot;) @GET @Produces(&quot;application/json&quot;) @PathParam(&quot;id&quot;) import javax.inject.Inject; import javax.enterprise.context.RequestScoped; @RequestScoped public class ActorResource { @Inject DatbaseBean db; public Actor getActor( int id) { return db.findActorById(id); } }
  • 30. Link Things Together <order self=&quot; http://example.com/orders/101230 &quot;> <customer ref=&quot; http://example.com/customers/bar &quot;> <product ref=&quot; http://example.com/products/21034 &quot;/> <amount value=&quot;1&quot;/> </order>
  • 31. Responses Contain Links HTTP/1.1 201 Created Date: Wed, 03 Jun 2009 16:41:58 GMT Server: Apache/1.3.6 Location: http://example.com/properties/foo Content-Type: application/order+xml Content-Length: 184 <property self=&quot; http://example.com/properties/foo &quot;> <parent ref=&quot; http://example.com/properties/bar &quot;/> <name>Foo</name> <value>1</value> </order>
  • 32. Responses Contain Links UriInfo provides information about deployment context, the request URI and the route to the resource
  • 33. UriBuilder provides facilities to easily construct URIs for resources
  • 34. Responses Contain Links @Context UriInfo i; SystemProperty p = ... UriBuilder b = i.getBaseUriBuilder(); URI u = b.path(SystemProperties.class) .path(p.getName()).build(); List<URI> ancestors = i.getMatchedURIs(); URI parent = ancestors.get(1);
  • 35. Responses Contain Links UriBuilder builder = UriBuilder.fromPath(&quot;/customers/{id}&quot;); builder.scheme(&quot;http&quot;) .host(&quot;{hostname}&quot;) .queryParam(&quot;param={param}&quot;); http://{hostname}/customers/{id}?param={param} UriBuilder clone = builder.clone(); URI uri = clone.build(&quot;example.com&quot;, &quot;333&quot;, &quot;value&quot;); http://example.com/customers/333?param=value
  • 36. Response codes and Exception Successful HTTP : 200 to 399 200 – OK 204 – No Content Standard HTTP error : 400 to 599 404 – Not Found 406 - Not Acceptable 405 - Method Not Allowed java.lang.Exception java.lang.RuntimeException javax.ws.rs.WebApplicationException throw new WebApplicationException(Response.Status.NOT_FOUND);
  • 37. Stateless Communications Long lived identifiers
  • 39. Everything required to process a request contained in the request
  • 40. Deployment JAX-RS application packaged in WAR like a servlet
  • 41. For JAX-RS aware containers web.xml can point to Application subclass For non-JAX-RS aware containers web.xml points to implementation-specific Servlet ; and
  • 42. an init-param identifies the Application subclass Resource classes and providers can access Servlet request, context, config and response via injection
  • 43. JAX-RS 1.1 Integration with Java EE 6 – Servlets 3.0 No or Portable “web.xml” <web-app> <servlet> <servlet-name>Jersey Web Application</servlet-name> <servlet-class> com.sun.jersey.spi.container.servlet.ServletContainer </servlet-class> <init-param> <param-name>javax.ws.rs.Application</param-name> <param-value>com.foo.MyApplication</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>Jersey Web Application</servlet-name> <url-pattern>/ resources /*</url-pattern> </servlet-mapping> </web-app> public class MyApplication extends javax.ws.rs.core.Application { } @ApplicationPath(“resources”)
  • 44. JAX-RS Summary Java API for building RESTful Web Services
  • 49. JAX-RS 1.1 Jersey Client-side API Consume HTTP-based RESTful Services
  • 50. Easy-to-use Better than HttpURLConnection! Reuses JAX-RS API Resources and URI are first-class citizens Not part of JAX-RS yet com.sun.jersey.api.client
  • 51. JAX-RS 1.1 Jersey Client API – Code Sample Client client = Client.create(); WebResource resource = client.resource(“...”); //curl http://example.com/base String s = resource.get(String.class); //curl -HAccept:text/plain http://example.com/base String s = resource. accept(“text/plain”). get(String.class); http://blogs.oracle.com/enterprisetechtips/entry/consuming_restful_web_services_with
  • 52. JAX-RS 1.1 WADL Representation of Resources Machine processable description of HTTP-based Applications
  • 53. Generated OOTB for the application <application xmlns=&quot;http://research.sun.com/wadl/2006/10&quot;> <doc xmlns:jersey=&quot;http://jersey.dev.java.net/&quot; jersey:generatedBy=&quot;Jersey: 1.1.4.1 11/24/2009 01:37 AM&quot;/> <resources base=&quot; http://localhost:8080/HelloWADL/resources/ &quot;> <resource path=&quot;generic&quot;> <method id=&quot;getText&quot; name=&quot; GET &quot;> <response> <representation mediaType=&quot;text/plain&quot;/> </response> </method> <method id=&quot;putText&quot; name=&quot; PUT &quot;> <request> <representation mediaType=&quot;text/plain&quot;/> </request> </method> </resource> </resources> </application>
  • 58. Demo
  • 59. Sabyasachi Ghosh, Senior Application Engneer Oracle India, @neilghosh Developing RESTful Web services with JAX-RS Thank You