Enviar pesquisa
Carregar
REST made simple with Java
•
Transferir como ODP, PDF
•
12 gostaram
•
2,277 visualizações
Niklas Gustavsson
Seguir
Slides from my SDC2009 presentation on JAX-RS.
Leia menos
Leia mais
Tecnologia
Design
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 59
Baixar agora
Recomendados
Oredev 2009 JAX-RS
Oredev 2009 JAX-RS
Niklas Gustavsson
Introduction to JAX-RS
Introduction to JAX-RS
Andreas Bjärlestam
Brief Intro To Jax Rs
Brief Intro To Jax Rs
Eduardo Pelegri-Llopart
Whats New in the Http Service Specification - Felix Meschberger
Whats New in the Http Service Specification - Felix Meschberger
mfrancis
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
b_kathir
RestFull Webservices with JAX-RS
RestFull Webservices with JAX-RS
Neil Ghosh
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
bmeme
RESTful Web Services with Jersey
RESTful Web Services with Jersey
Scott Leberknight
Recomendados
Oredev 2009 JAX-RS
Oredev 2009 JAX-RS
Niklas Gustavsson
Introduction to JAX-RS
Introduction to JAX-RS
Andreas Bjärlestam
Brief Intro To Jax Rs
Brief Intro To Jax Rs
Eduardo Pelegri-Llopart
Whats New in the Http Service Specification - Felix Meschberger
Whats New in the Http Service Specification - Felix Meschberger
mfrancis
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
b_kathir
RestFull Webservices with JAX-RS
RestFull Webservices with JAX-RS
Neil Ghosh
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
bmeme
RESTful Web Services with Jersey
RESTful Web Services with Jersey
Scott Leberknight
So various polymorphism in Scala
So various polymorphism in Scala
b0ris_1
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Marco Gralike
Jersey and JAX-RS
Jersey and JAX-RS
Eduardo Pelegri-Llopart
RESTEasy
RESTEasy
Massimiliano Dessì
Dropwizard
Dropwizard
Scott Leberknight
Services in Drupal 8
Services in Drupal 8
Andrei Jechiu
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Marcelo Altmann
JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup
Sagara Gunathunga
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
Sagara Gunathunga
Apache Beam de A à Z
Apache Beam de A à Z
Paris Data Engineers !
the Spring 4 update
the Spring 4 update
Joshua Long
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
jaxconf
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Codemotion
Database Connection Pooling With c3p0
Database Connection Pooling With c3p0
Kasun Madusanke
Kommons
Kommons
Antonio Terreno
Spotify services (SDC 2013)
Spotify services (SDC 2013)
Niklas Gustavsson
Spotify services - Leetspeak 2014
Spotify services - Leetspeak 2014
Niklas Gustavsson
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Dan Mohl
Modern Software Architecture Styles and Patterns
Modern Software Architecture Styles and Patterns
Ganesh Samarthyam
The Modern Software Architect
The Modern Software Architect
Niels Bech Nielsen
Spotify architecture - Pressing play
Spotify architecture - Pressing play
Niklas Gustavsson
Spotify: Data center & Backend buildout
Spotify: Data center & Backend buildout
David Poblador i Garcia
Mais conteúdo relacionado
Mais procurados
So various polymorphism in Scala
So various polymorphism in Scala
b0ris_1
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Marco Gralike
Jersey and JAX-RS
Jersey and JAX-RS
Eduardo Pelegri-Llopart
RESTEasy
RESTEasy
Massimiliano Dessì
Dropwizard
Dropwizard
Scott Leberknight
Services in Drupal 8
Services in Drupal 8
Andrei Jechiu
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Marcelo Altmann
JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup
Sagara Gunathunga
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
Sagara Gunathunga
Apache Beam de A à Z
Apache Beam de A à Z
Paris Data Engineers !
the Spring 4 update
the Spring 4 update
Joshua Long
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
jaxconf
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Codemotion
Database Connection Pooling With c3p0
Database Connection Pooling With c3p0
Kasun Madusanke
Kommons
Kommons
Antonio Terreno
Mais procurados
(15)
So various polymorphism in Scala
So various polymorphism in Scala
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Jersey and JAX-RS
Jersey and JAX-RS
RESTEasy
RESTEasy
Dropwizard
Dropwizard
Services in Drupal 8
Services in Drupal 8
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
Apache Beam de A à Z
Apache Beam de A à Z
the Spring 4 update
the Spring 4 update
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Getting Started with WebSocket and Server-Sent Events using Java by Arun Gupta
Database Connection Pooling With c3p0
Database Connection Pooling With c3p0
Kommons
Kommons
Destaque
Spotify services (SDC 2013)
Spotify services (SDC 2013)
Niklas Gustavsson
Spotify services - Leetspeak 2014
Spotify services - Leetspeak 2014
Niklas Gustavsson
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Dan Mohl
Modern Software Architecture Styles and Patterns
Modern Software Architecture Styles and Patterns
Ganesh Samarthyam
The Modern Software Architect
The Modern Software Architect
Niels Bech Nielsen
Spotify architecture - Pressing play
Spotify architecture - Pressing play
Niklas Gustavsson
Spotify: Data center & Backend buildout
Spotify: Data center & Backend buildout
David Poblador i Garcia
Software Architecture Patterns
Software Architecture Patterns
Assaf Gannon
Big Data At Spotify
Big Data At Spotify
Adam Kawa
A Spotify Presentation - Case studies
A Spotify Presentation - Case studies
Emily Wilkinson
Algorithmic Music Recommendations at Spotify
Algorithmic Music Recommendations at Spotify
Chris Johnson
Music Recommendations at Scale with Spark
Music Recommendations at Scale with Spark
Chris Johnson
Scala Data Pipelines for Music Recommendations
Scala Data Pipelines for Music Recommendations
Chris Johnson
Interactive Recommender Systems with Netflix and Spotify
Interactive Recommender Systems with Netflix and Spotify
Chris Johnson
From Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover Weekly
Chris Johnson
Destaque
(15)
Spotify services (SDC 2013)
Spotify services (SDC 2013)
Spotify services - Leetspeak 2014
Spotify services - Leetspeak 2014
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Modern Software Architectures: Building Solutions for Web, Cloud, and Mobile
Modern Software Architecture Styles and Patterns
Modern Software Architecture Styles and Patterns
The Modern Software Architect
The Modern Software Architect
Spotify architecture - Pressing play
Spotify architecture - Pressing play
Spotify: Data center & Backend buildout
Spotify: Data center & Backend buildout
Software Architecture Patterns
Software Architecture Patterns
Big Data At Spotify
Big Data At Spotify
A Spotify Presentation - Case studies
A Spotify Presentation - Case studies
Algorithmic Music Recommendations at Spotify
Algorithmic Music Recommendations at Spotify
Music Recommendations at Scale with Spark
Music Recommendations at Scale with Spark
Scala Data Pipelines for Music Recommendations
Scala Data Pipelines for Music Recommendations
Interactive Recommender Systems with Netflix and Spotify
Interactive Recommender Systems with Netflix and Spotify
From Idea to Execution: Spotify's Discover Weekly
From Idea to Execution: Spotify's Discover Weekly
Semelhante a REST made simple with Java
REST made simple with Java
REST made simple with Java
elliando dias
REST
REST
Andreas Bjärlestam
CDI, Seam & RESTEasy: You haven't seen REST yet!
CDI, Seam & RESTEasy: You haven't seen REST yet!
Dan Allen
Overview of RESTful web services
Overview of RESTful web services
nbuddharaju
JAX-RS.next
JAX-RS.next
Michal Gajdos
May 2010 - RestEasy
May 2010 - RestEasy
JBug Italy
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
Alona Mekhovova
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
Carol McDonald
Java Servlets
Java Servlets
BG Java EE Course
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
Geert Van Pamel
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
Christian Thilmany
03 form-data
03 form-data
snopteck
What's Coming in Spring 3.0
What's Coming in Spring 3.0
Matt Raible
Java Technology
Java Technology
ifnu bima
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
Li Yi
JAX-RS 2.0 and OData
JAX-RS 2.0 and OData
Anil Allewar
soft-shake.ch - JAX-RS and Java EE 6
soft-shake.ch - JAX-RS and Java EE 6
soft-shake.ch
RESTful SCA with Apache Tuscany
RESTful SCA with Apache Tuscany
Raymond Feng
Hammock, a Good Place to Rest
Hammock, a Good Place to Rest
Stratoscale
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
ciklum_ods
Semelhante a REST made simple with Java
(20)
REST made simple with Java
REST made simple with Java
REST
REST
CDI, Seam & RESTEasy: You haven't seen REST yet!
CDI, Seam & RESTEasy: You haven't seen REST yet!
Overview of RESTful web services
Overview of RESTful web services
JAX-RS.next
JAX-RS.next
May 2010 - RestEasy
May 2010 - RestEasy
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
Java Servlets
Java Servlets
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
03 form-data
03 form-data
What's Coming in Spring 3.0
What's Coming in Spring 3.0
Java Technology
Java Technology
RESTful SOA - 中科院暑期讲座
RESTful SOA - 中科院暑期讲座
JAX-RS 2.0 and OData
JAX-RS 2.0 and OData
soft-shake.ch - JAX-RS and Java EE 6
soft-shake.ch - JAX-RS and Java EE 6
RESTful SCA with Apache Tuscany
RESTful SCA with Apache Tuscany
Hammock, a Good Place to Rest
Hammock, a Good Place to Rest
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
Mais de Niklas Gustavsson
Real-time web
Real-time web
Niklas Gustavsson
RESTful web services
RESTful web services
Niklas Gustavsson
Not only SQL
Not only SQL
Niklas Gustavsson
HTML5
HTML5
Niklas Gustavsson
The future is bright
The future is bright
Niklas Gustavsson
CouchDB
CouchDB
Niklas Gustavsson
Apachecon Eu 2008 Mina
Apachecon Eu 2008 Mina
Niklas Gustavsson
Mais de Niklas Gustavsson
(7)
Real-time web
Real-time web
RESTful web services
RESTful web services
Not only SQL
Not only SQL
HTML5
HTML5
The future is bright
The future is bright
CouchDB
CouchDB
Apachecon Eu 2008 Mina
Apachecon Eu 2008 Mina
Último
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Khem
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Results
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
wesley chun
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
Último
(20)
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Slack Application Development 101 Slides
Slack Application Development 101 Slides
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
REST made simple with Java
1.
SDC 2008
REST made simple with Java
2.
Niklas Gustavsson [email_address]
http://protocol7.com http://twitter.com/protocol7
3.
REST made simple
with Java
4.
REST?
5.
HTTP 1.1
6.
Some HTTP history
7.
Some HTTP history
8.
HTTP done right
9.
10.
Principles
11.
Principles Everything is
a resource
12.
Principles A resource
has an identifier http://example.com/customers/1453
13.
Principles We transfer
representations
14.
Principles All resources
expose a uniform interface GET, POST, PUT, DELETE
15.
Principles Hypermedia as
the engine of application state
16.
Principles Client-server, Stateless,
Cacheable, Layered
17.
Why?
18.
Why? It's easy!
Well, it's not
19.
Why? It's what
the cool kids use
20.
Why? Web has
been successful, copy!
21.
Why? It's what
others use
22.
Why? Interoperability on
the right level
23.
Frameworks, yeay!
24.
JAX-RS (aka JSR-311)
25.
Jersey http://jersey.dev.java.net
Restlets http://www.restlet.org RESTeasy http://www.jboss.org/resteasy CXF http://cxf.apache.org
26.
POJO based Annotation
heavy
27.
Resources
28.
Code! Show me
the code!
29.
public class TimeReportService
{ private TimeReportDao reportDao; public TimeReport getReport(String username) { return reportDao.forUser(username); } public void saveReport(TimeReport report) { reportDao.update(report); } ... }
30.
Request mapping
31.
@Path("report") public class
TimeReportService { private TimeReportDao reportDao; @GET public TimeReport getReport(String username) { return reportDao.forUser(username); } @PUT public void saveReport(TimeReport report) { reportDao.update(report); } ... }
32.
33.
public class TimeReportApplication
extends Application { @Override public Set<Class<?>> getClasses() { Set<Class<?>> resources = new HashSet<Class<?>>(); resources.add(TimeReportService.class); return resources; } }
34.
Path parameters and
contexts
35.
@Path("{username}/report") public class
TimeReportService { @GET public TimeReport getReport(@PathParam("username") String username) { return reportDao.forUser(username); } ... } http://example.com/niklas/report
36.
@GET public TimeReport
getReport(@Context SecurityContext sc) { if(sc.isSecure()) { Principal user = sc.getUserPrincipal(); return reportDao.forUser(user.getName()); } else { ... throw error, redirect to login } }
37.
@GET public TimeReport
getReport(@CookieParam("username") String username) { return reportDao.forUser(username); }
38.
39.
Any media type
is allowed XML, JSON, text/plain, Binary files, ...
40.
Entity providers MessageBodyReader,
MessageBodyWriter
41.
Standard Entity providers
42.
43.
Writing your own
Entity provider
44.
BEGIN:VFREEBUSY DTSTART:20090324T080000Z DTEND:20090324T170000Z
DTSTAMP:20090316T123136Z UID:ca668b14ddf589ea8650b0b992eb64a656cdbc7e@google.com SUMMARY:SDC2009 END:VFREEBUSY
45.
@Provider @Produces("text/calendar") public
class TimeReportICalWriter implements MessageBodyWriter<TimeReport> { public void writeTo(TimeReport t, Class<?> type, Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) { PrintWriter wr = new PrintWriter(entityStream); ... for(TimeRange range : t.getRanges()) { wr.println("BEGIN:VFREEBUSY"); wr.println("DTSTART:" + DF.format(range.getStartTime())); wr.println("DTEND:" + DF.format(range.getEndTime())); wr.println("SUMMARY:" + range.getDescription()); wr.println("END:VFREEBUSY"); } ... }
46.
Response, ResponseBuilder
47.
Exception Mapping
48.
Deployment
49.
JAX-RS limitations
50.
JAX-RS limitations Lifecycle
support
51.
JAX-RS limitations Weak
support for links, caching, method tunneling
52.
JAX-RS limitations Accept
based content negotiation only http://example.com/report http://example.com/report.xml http://example.com/report.cal http://example.com/report.json
53.
JAX-RS limitations Limited
security support
54.
JAX-RS limitations Leaky
abstraction
55.
Try it out!
And have a look at the alternatives
56.
Want more?
57.
Questions?
58.
[email_address]
59.
Attributions http://www.flickr.com/photos/psd/421186578/ http://www.flickr.com/photos/sineout/2491569707/
http://www.flickr.com/photos/apelad/sets/72157594388426362/ http://www.flickr.com/photos/goopymart/289959670
Baixar agora