SlideShare a Scribd company logo
REST based web applications with Spring 3

Oliver Gierke - Senior Consultant




                                    © 2010 SpringSource, A division of VMware. All rights reserved
Agenda
 Intro

 What is REST all about?

 Recap: @Controller

 What‘s new in Spring MVC 3.0?

 What‘s beyond Spring MVC

 Demo

                                  2
About
 Oliver Gierke - Senior Consultant
                                                Hi! My
                                                name is...
 OpenSource enthusiast

 (OR)Persistence, Web, Integration

 ogierke@vmware.com

 http://www.olivergierke.de /   olivergierke




                                                             3
SpringSource - a division of VMware
 Spring Framework
 • exhaustive ecosystem

 Roo

 Groovy / Grails

 Tomcat / tc Server / Hyperic




                                      4
REST




       5
The architecture of the web

                              6
Identifiers
                     Verbs
         Resources

   Hypermedia         Representations
                                        7
Spring MVC




             8
Spring MVC
     Model   View   Controller




                                 9
Recap: Spring MVC 2.5




                        10
@Controller
@Controller
@RequestMapping(„/addresses“)
public class AddressController {

    @RequestMapping(value=“/address“, method = GET)
    public String showAddress(
                    @RequestParam Long id, Model model) {…}
}


                                                          11
Strongly typed methods
@RequestMapping(value=“/address“, method = GET)
public String showAddress(
                  @RequestParam Long id, Model model) {…}


                        Strongly typed    Other special
     View name
                      request parameter      types


                                                          12
What‘s new in Spring MVC 3.0
 @PathVariable

 Content negotiation

 ResponseBody / RequestBody / ResponseStatus

 Declarative validation (JSR-303)




                                                13
@PathVariable
@RequestMapping(value=“/addresses/{id}“, method = GET)
public String showAddress(
                  @PathVariable Long id, Model model) {…}




                                                        14
Content negotiation
http://myapp.com/addresses/1.xml
http://myapp.com/addresses/1.json
http://myapp.com/addresses/1.html

     Accept: application/xml
     Accept: application/json
     Accept: application/html


                                    15
@ResposeBody
@RequestMapping(value=“/addresses/{id}“, method = GET)
@ResponseBody
public Address showAddress(
                  @PathVariable Long id, Model model) {…}




                                                        16
@ResponseStatus
@ResponseStatus(NOT_FOUND)
public class MyException extends RuntimeException {…}




                                                        17
@ResponseStatus
@RequestMapping(value=“/addresses/{id}“, method = GET)
public String showAddress(
                  @PathVariable Long id, Model model) {
  if (id == null)
    throw new MyException();
  …
}


                                                          18
@RequestBody
@RequestMapping(value=“/addresses“, method = POST)
@ResponseStatus(CREATED)
public void createAddress(
                  @RequestBody Address address) {…}




                                                      19
Declarative Validation
@RequestMapping(value=“/addresses“, method = POST)
@ResponseStatus(CREATED)
public void createAddress(
                 @RequestBody @Valid Address address) {…}




                                                        20
What‘s new in Spring MVC 3.0
 New data binding and type conversion service

 Object-XML-Mapping

 HiddenHttpMethodFilter

 XML namespace




                                                 21
Demo




       22
Where do we
go from here?




                23
Spring WebServices


 Spring WebFlow
                          Spring Integration


              Spring Ecosystem

         Spring Batch
                              Spring Roo

Spring Security

                                               24
Demo




       25
Questions




            26
Resources
 Sample: http://github.com/olivergierke/spring-rest

 Petcare: http://src.springsource.org/svn/spring-samples/petcare/trunk

 Photos: http://www.sxc.hu/




                                                                          27

More Related Content

PDF
Spring MVC to iOS and the REST
Roy Clarkson
 
KEY
Multi Client Development with Spring
Joshua Long
 
PDF
the Spring 4 update
Joshua Long
 
PDF
REST APIs with Spring
Joshua Long
 
PPTX
Spring Boot and REST API
07.pallav
 
PDF
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
PDF
Java(ee) mongo db applications in the cloud
Shekhar Gulati
 
PPTX
10 Laravel packages everyone should know
Povilas Korop
 
Spring MVC to iOS and the REST
Roy Clarkson
 
Multi Client Development with Spring
Joshua Long
 
the Spring 4 update
Joshua Long
 
REST APIs with Spring
Joshua Long
 
Spring Boot and REST API
07.pallav
 
Lecture 7 Web Services JAX-WS & JAX-RS
Fahad Golra
 
Java(ee) mongo db applications in the cloud
Shekhar Gulati
 
10 Laravel packages everyone should know
Povilas Korop
 

What's hot (20)

PPTX
Servletarchitecture,lifecycle,get,post
vamsi krishna
 
PDF
Java REST API Framework Comparison - UberConf 2021
Matt Raible
 
PPT
Using Java to implement SOAP Web Services: JAX-WS
Katrien Verbert
 
PPTX
The Full Power of ASP.NET Web API
Eyal Vardi
 
PPTX
The Past Year in Spring for Apache Geode
VMware Tanzu
 
PPTX
Spring boot for buidling microservices
Nilanjan Roy
 
PDF
BOSH / CF Deployment in modern ways #cf_tokyo
Toshiaki Maki
 
PDF
Making the Most of Your Gradle Build
Andres Almiray
 
PDF
Making the Most of Your Gradle Build
Andres Almiray
 
PPTX
Spring boot Introduction
Jeevesh Pandey
 
PPT
JAX-WS Basics
Wes Williams
 
PDF
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
Joshua Long
 
PDF
Why PCF is the best platform for Spring Boot
Toshiaki Maki
 
PDF
Introduction to Spring WebFlux #jsug #sf_a1
Toshiaki Maki
 
PDF
PUC SE Day 2019 - SpringBoot
Josué Neis
 
PDF
The JavaFX Ecosystem
Andres Almiray
 
PDF
Apache DeltaSpike the CDI toolbox
Antoine Sabot-Durand
 
PDF
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
PDF
Server-Side Programming Primer
Ivano Malavolta
 
PDF
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
DynamicInfraDays
 
Servletarchitecture,lifecycle,get,post
vamsi krishna
 
Java REST API Framework Comparison - UberConf 2021
Matt Raible
 
Using Java to implement SOAP Web Services: JAX-WS
Katrien Verbert
 
The Full Power of ASP.NET Web API
Eyal Vardi
 
The Past Year in Spring for Apache Geode
VMware Tanzu
 
Spring boot for buidling microservices
Nilanjan Roy
 
BOSH / CF Deployment in modern ways #cf_tokyo
Toshiaki Maki
 
Making the Most of Your Gradle Build
Andres Almiray
 
Making the Most of Your Gradle Build
Andres Almiray
 
Spring boot Introduction
Jeevesh Pandey
 
JAX-WS Basics
Wes Williams
 
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
Joshua Long
 
Why PCF is the best platform for Spring Boot
Toshiaki Maki
 
Introduction to Spring WebFlux #jsug #sf_a1
Toshiaki Maki
 
PUC SE Day 2019 - SpringBoot
Josué Neis
 
The JavaFX Ecosystem
Andres Almiray
 
Apache DeltaSpike the CDI toolbox
Antoine Sabot-Durand
 
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
Server-Side Programming Primer
Ivano Malavolta
 
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
DynamicInfraDays
 
Ad

Viewers also liked (19)

PDF
Spring Roo 1.0.0 Technical Deep Dive
Ben Alex
 
PDF
Mylyn - Increasing developer productivity
Oliver Gierke
 
PDF
Whoops! Where did my architecture go?
Oliver Gierke
 
PDF
Coding & Music Passion And Profession
Oliver Gierke
 
PDF
Spring Data and MongoDB
Oliver Gierke
 
PDF
Spring Data and MongoDB
Oliver Gierke
 
PDF
Whoops! where did my architecture go?
Oliver Gierke
 
PDF
Generic DAOs With Hades
Oliver Gierke
 
KEY
Sophisticated JPA with Spring & Hades
Oliver Gierke
 
PDF
Increasing developer procutivity with Mylyn (Devoxx 2010)
Oliver Gierke
 
PDF
Real world dependency injection - DPC10
Stephan Hochdörfer
 
PDF
Spring in action - Hades & Spring Roo
Oliver Gierke
 
PDF
Mylyn
Oliver Gierke
 
PDF
Data Access 2.0? Please welcome, Spring Data!
Oliver Gierke
 
PDF
An introduction into Spring Data
Oliver Gierke
 
PDF
Spring integration
Oliver Gierke
 
PDF
Spring Data JPA - Repositories done right
Oliver Gierke
 
PDF
Data access 2.0? Please welcome: Spring Data!
Oliver Gierke
 
PDF
Whoops! Where did my architecture go?
Oliver Gierke
 
Spring Roo 1.0.0 Technical Deep Dive
Ben Alex
 
Mylyn - Increasing developer productivity
Oliver Gierke
 
Whoops! Where did my architecture go?
Oliver Gierke
 
Coding & Music Passion And Profession
Oliver Gierke
 
Spring Data and MongoDB
Oliver Gierke
 
Spring Data and MongoDB
Oliver Gierke
 
Whoops! where did my architecture go?
Oliver Gierke
 
Generic DAOs With Hades
Oliver Gierke
 
Sophisticated JPA with Spring & Hades
Oliver Gierke
 
Increasing developer procutivity with Mylyn (Devoxx 2010)
Oliver Gierke
 
Real world dependency injection - DPC10
Stephan Hochdörfer
 
Spring in action - Hades & Spring Roo
Oliver Gierke
 
Data Access 2.0? Please welcome, Spring Data!
Oliver Gierke
 
An introduction into Spring Data
Oliver Gierke
 
Spring integration
Oliver Gierke
 
Spring Data JPA - Repositories done right
Oliver Gierke
 
Data access 2.0? Please welcome: Spring Data!
Oliver Gierke
 
Whoops! Where did my architecture go?
Oliver Gierke
 
Ad

Similar to REST based web applications with Spring 3 (20)

PDF
Building Next-Gen Web Applications with the Spring 3 Web Stack
Jeremy Grelle
 
PPT
Spring-training-in-bangalore
TIB Academy
 
PDF
Spring MVC introduction HVA
Peter Maas
 
KEY
Multi client Development with Spring
Joshua Long
 
PDF
Spring Mvc
ifnu bima
 
PPTX
Spring Framework 3.2 - What's New
Sam Brannen
 
PDF
Spring 3.1 in a Nutshell
Sam Brannen
 
PPTX
Rest presentation
srividhyau
 
PDF
Multi Client Development with Spring - Josh Long
jaxconf
 
PDF
Building RESTful applications using Spring MVC
IndicThreads
 
KEY
A Walking Tour of (almost) all of Springdom
Joshua Long
 
PDF
Extending spring
Joshua Long
 
PDF
Javaone 2010
Hien Luu
 
PDF
Introducing spring
Ernesto Hernández Rodríguez
 
PDF
RESTful Web services using JAX-RS
Arun Gupta
 
PPTX
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Sam Brannen
 
PDF
Spring 4 Web App
Rossen Stoyanchev
 
PDF
Spring Framework - MVC
Dzmitry Naskou
 
PDF
Spring 3.1 in a Nutshell - JAX London 2011
Sam Brannen
 
PDF
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 
Building Next-Gen Web Applications with the Spring 3 Web Stack
Jeremy Grelle
 
Spring-training-in-bangalore
TIB Academy
 
Spring MVC introduction HVA
Peter Maas
 
Multi client Development with Spring
Joshua Long
 
Spring Mvc
ifnu bima
 
Spring Framework 3.2 - What's New
Sam Brannen
 
Spring 3.1 in a Nutshell
Sam Brannen
 
Rest presentation
srividhyau
 
Multi Client Development with Spring - Josh Long
jaxconf
 
Building RESTful applications using Spring MVC
IndicThreads
 
A Walking Tour of (almost) all of Springdom
Joshua Long
 
Extending spring
Joshua Long
 
Javaone 2010
Hien Luu
 
Introducing spring
Ernesto Hernández Rodríguez
 
RESTful Web services using JAX-RS
Arun Gupta
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Sam Brannen
 
Spring 4 Web App
Rossen Stoyanchev
 
Spring Framework - MVC
Dzmitry Naskou
 
Spring 3.1 in a Nutshell - JAX London 2011
Sam Brannen
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
JAX London
 

Recently uploaded (20)

PDF
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
PPT
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
GYTPOL If You Give a Hacker a Host
linda296484
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
GYTPOL If You Give a Hacker a Host
linda296484
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Software Development Methodologies in 2025
KodekX
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 

REST based web applications with Spring 3