Slide 1

Slide 1 text

B U I L D I N G R E S T S E RV I C E S W I T H github.com/joshlong/the-spring-rest-stack Spring Josh Long (⻰龙之春) @starbuxman joshlong.com [email protected] slideshare.net/joshlong github.com/joshlong speakerdeck.com/joshlong

Slide 2

Slide 2 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK ABOUT ME About Josh Long (⻰龙之春) Spring Developer Advocate, Pivotal Jean Claude van Damme! Java mascot Duke some thing’s I’ve authored... @starbuxman [email protected] slideshare.net/joshlong github.com/joshlong speakerdeck.com/joshlong

Slide 3

Slide 3 text

Starting with Spring T H E S P R I N G R E S T S TA C K

Slide 4

Slide 4 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING IO WEB Controllers, REST,
 WebSocket INTEGRATION Channels, Adapters,
 Filters, Transformers BATCH Jobs, Steps,
 Readers, Writers BIG DATA Ingestion, Export,
 Orchestration, Hadoop DATA NON-RELATIONAL RELATIONAL CORE GROOVY FRAMEWORK SECURITY REACTOR GRAILS Full-stack, Web XD Stream, Taps, Jobs BOOT Bootable, Minimal, Ops-Ready

Slide 5

Slide 5 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK A NEW HOME FOR SPRING

Slide 6

Slide 6 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK A NEW HOME FOR SPRING

Slide 7

Slide 7 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING 4 websockets : supports JSR 356, native APIs ! Async RestTemplate 
 based on NIO 2 HTTP client in JDK.
 Java SE 8 and Java EE 7 extends support 
 to emerging platforms

Slide 8

Slide 8 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING 4 @Conditional provides the ability to conditionally 
 create a bean ! ! ! ! ! And, best of all, @Conditional powers Spring Boot! @Conditional (NasdaqIsUpCondition.class)
 @Bean
 Mongo extraMongoNode(){ // ... }

Slide 9

Slide 9 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING BOOT single point of focus, production- ready, easy to customize ! Installation: > Java 1.6 or better > Maven 3.0 or better > optionally install spring CLI 
 (or gvm or brew)

Slide 10

Slide 10 text

Demonstration Take Spring Boot CLI for
 a spin around the block !

Slide 11

Slide 11 text

Demonstration Take Spring Boot around the track. !

Slide 12

Slide 12 text

T H E S P R I N G R E S T S TA C K Testing

Slide 13

Slide 13 text

Demonstration how to write unit tests with Spring

Slide 14

Slide 14 text

Spring MVC T H E S P R I N G R E S T S TA C K

Slide 15

Slide 15 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK MODEL VIEW CONTROLLER DispatcherServlet controller view template delegate request delegate rendering of response render response return control model model incoming requests return response stop me if you’ve heard this one before 
 
 ...

Slide 16

Slide 16 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK INSTALLING SPRING MVC org.springframework.web.context.ContextLoaderListener contextInitializerClasses my.ApplicationContextInitializer contextClass org.springframework.web.context.support.AnnotationConfigWebApplicationContext appServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation ` 1 appServlet / web.xml

Slide 17

Slide 17 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK INSTALLING SPRING MVC ! public class SampleWebApplicationInitializer implements WebApplicationInitializer { ! public void onStartup(ServletContext sc) throws ServletException { AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext(); ac.setServletContext(sc); ac.scan( “a.package.full.of.services”, “a.package.full.of.controllers” ); ! sc.addServlet("spring", new DispatcherServlet(ac)); ! // register filters, other servlets, etc., to get Spring and Spring Boot working } } WebApplicationInitializer ~= Java web.xml

Slide 18

Slide 18 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK INSTALLING SPRING MVC public class SimplerDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { ! @Override protected Class>[] getRootConfigClasses() { return new Class>[]{ ServiceConfiguration.class }; } ! @Override protected Class>[] getServletConfigClasses() { return new Class>[]{ WebMvcConfiguration.class }; } ! @Override protected String[] getServletMappings() { return new String[]{"/*"}; } } or, just fill out the form...

Slide 19

Slide 19 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK INSTALLING SPRING MVC @ComponentScan @EnableAutoConfiguration public class Application extends SpringBootServletInitializer { ! private static Class< Application> applicationClass = Application.class; ! public static void main(String[] args) { SpringApplication.run(applicationClass); } ! @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(applicationClass); } } ! or, just use Spring Boot and never worry about it

Slide 20

Slide 20 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK A RICH SERVLET TOOLKIT HttpRequestHandlers supports remoting technologies : Caucho, HTTP Invoker, etc. DelegatingFilterProxy javax.filter.Filter that delegates to a Spring-managed bean HandlerInterceptor wraps requests to HttpRequestHandlers ServletWrappingController lets you force requests to a servlet through the Spring Handler chain WebApplicationContextUtils look up the current ApplicationContext given a ServletContext HiddenHttpMethodFilter routes HTTP requests to the appropriate endpoint other niceties Spring’s web support provides:

Slide 21

Slide 21 text

T H E S P R I N G R E S T S TA C K REST Essentials

Slide 22

Slide 22 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK MOTIVATIONS FOR REST meanwhile, in the enterprise, somebody is using SOAP because it’s “SIMPLE”

Slide 23

Slide 23 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK WHAT IS REST? REST is an architectural constraint based on HTTP 1.1, and created as part of Roy Fielding’s doctoral dissertation in 2000.
 
 It embraces HTTP. 
 It’s a style, not a standard http://en.wikipedia.org/wiki/Representational_state_transfer


Slide 24

Slide 24 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK WHAT IS REST? REST has no hard and fast rules. REST is an architectural style, not a standard. REST uses Headers to describe requests & responses REST embraces HTTP verbs. (DRY)

Slide 25

Slide 25 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HTTP VERBS GET /users/21 GET requests retrieve information. GET can have side-effects (but it’s unexpected) GET can be conditional, or partial: 
 If-Modified-Since, Range !

Slide 26

Slide 26 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HTTP VERBS DELETE requests that a resource be removed, though the deletion doesn’t have to be immediate. DELETE /users/21

Slide 27

Slide 27 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HTTP VERBS POST requests that the resource do something with the enclosed entity POST can be used to create or update. 
 ! POST /users { “firstName”: “Juergen” }

Slide 28

Slide 28 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HTTP VERBS PUT requests that the entity be stored at a URI PUT can be used to create or update. PUT /users/21 { “firstName”: “Juergen” }

Slide 29

Slide 29 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK STATUS CODES status codes convey the result of the server’s attempt to satisfy the request. 
 
 Categories: 1xx: informational
 2xx: success
 3xx: redirection
 4xx: client error 
 5xx: server error 


Slide 30

Slide 30 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK STATUS CODES 200 OK - Everything worked ! 201 Created - Returns a Location header for new resource ! 202 Accepted - server has accepted the request, but it is not yet complete. Status URI optionally conveyed in Location header

Slide 31

Slide 31 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK STATUS CODES 400 Bad Request - Malformed Syntax. Retry with change. ! 401 Unauthorized - authentication is required 
 403 Forbidden - server has understood, but refuses request
 
 404 Not Found - server can’t find a resource for URI 
 406 Incompatible - incompatible Accept headers specified
 409 Conflict - resource conflicts with client request

Slide 32

Slide 32 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK CONTENT NEGOTIATION Clients and services must agree on a representation media type through content negotiation. ! Client specifies what it wants through Accept header 
 Server specifies what it produces through Content-Type header !

Slide 33

Slide 33 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK CONTENT NEGOTIATION If no match is made, the client will receive a 406 Not Acceptable

Slide 34

Slide 34 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK CONTENT NEGOTIATION Spring MVC supports multiple types of content negotiation through its ContentNegotiationStrategy: e.g., Accept header, URL extension, request parameters, or a fixed type


Slide 35

Slide 35 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SOME REST POWER TOOLS Advanced REST Client

Slide 36

Slide 36 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SOME REST POWER TOOLS Poster

Slide 37

Slide 37 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SOME REST POWER TOOLS ➜ ~ curl -X POST -u android-crm:123456 http://localhost:8080/oauth/token \
 -H "Accept: application/json" \ 
 -d "password=......" ! {"access_token":"426481ea-c3eb-45a0-8b2d-d1f9cfae0fcc","token_type":"bearer","expires ! ➜ ~ curl

Slide 38

Slide 38 text

T H E S P R I N G R E S T S TA C K Towards Hypermedia

Slide 39

Slide 39 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK THE MATURITY MODEL The Richardson Maturity Model is a way to grade your API according to the REST constraints with 4 levels of increasing compliance ! http://martinfowler.com/articles/richardsonMaturityModel.html

Slide 40

Slide 40 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK THE MATURITY MODEL The Richardson Maturity Model 
 
 Level 0: swamp of POX
 http://martinfowler.com/articles/richardsonMaturityModel.html Uses HTTP mainly as a tunnel through one URI
 e.g., SOAP, XML-RPC
 
 Usually features on HTTP verb (POST)


Slide 41

Slide 41 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK THE MATURITY MODEL The Richardson Maturity Model 
 
 Level 1: resources
 http://martinfowler.com/articles/richardsonMaturityModel.html Multiple URIs to distinguish related nouns 
 e.g., /articles/1, /articles/2, vs. just /articles
 


Slide 42

Slide 42 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK THE MATURITY MODEL The Richardson Maturity Model 
 
 Level 2: HTTP verbs
 http://martinfowler.com/articles/richardsonMaturityModel.html leverage transport-native properties to enhance service 
 e.g., HTTP GET and PUT and DELETE and POST
 
 Uses idiomatic HTTP controls like status codes, headers 


Slide 43

Slide 43 text

Demonstration Our first @RestController

Slide 44

Slide 44 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HATEOAS The Richardson Maturity Model 
 
 Level 3: Hypermedia Controls (aka, HATEOAS)
 http://martinfowler.com/articles/richardsonMaturityModel.html No a priori knowledge of service required
 Navigation options are provided by service and hypermedia controls
 
 Promotes longevity through a uniform interface
 


Slide 45

Slide 45 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HATEOAS Links provide possible navigations from a given resource ! Links are dynamic, based on resource state. ! ! { href: “http://...:8080/users/232/customers”, rel: “customers” }

Slide 46

Slide 46 text

Demonstration Working with Hypermedia and 
 Spring HATEOAS

Slide 47

Slide 47 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING DATA REST Spring Data REST simplifies the 
 generic data-centric @Controllers ! Builds on top of Spring Data Repository support: @RestResource (path = "users", rel = "users") 
 public interface UserRepository extends PagingAndSortingRepository { ! User findByUsername(@Param ("username") String username); !

Slide 48

Slide 48 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING DATA REST Spring Data REST simplifies the 
 generic data-centric @Controllers ! Builds on top of Spring Data Repository support: @RestResource (path = "users", rel = "users") 
 public interface UserRepository extends PagingAndSortingRepository { ! User findByUsername(@Param ("username") String username); ! ! ! select u from User where u.username = ?

Slide 49

Slide 49 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING DATA REST Spring Data REST simplifies the 
 generic data-centric @Controllers ! Builds on top of Spring Data Repository support: @RestResource (path = "users", rel = "users") 
 public interface UserRepository extends PagingAndSortingRepository { ! List findUsersByFirstNameOrLastNameOrUsername(
 @Param ("firstName") String firstName, 
 @Param ("lastName") String lastName, 
 @Param ("username") String username); }

Slide 50

Slide 50 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING DATA REST Spring Data REST simplifies the 
 generic data-centric @Controllers ! Builds on top of Spring Data Repository support: @RestResource (path = "users", rel = "users") 
 public interface UserRepository extends PagingAndSortingRepository { ! List findUsersByFirstNameOrLastNameOrUsername(
 @Param ("firstName") String firstName, 
 @Param ("lastName") String lastName, 
 @Param ("username") String username); } select u from User u where u.username = ? or u.firstName = ? or u.lastName = ?

Slide 51

Slide 51 text

T H E S P R I N G R E S T S TA C K Testing REST

Slide 52

Slide 52 text

Demonstration Testing web services with 
 Spring MVC Test framework

Slide 53

Slide 53 text

T H E S P R I N G R E S T S TA C K Error Handling

Slide 54

Slide 54 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK HANDLING ERRORS IN A REST API Developers learn to use an API through errors Extreme programming and Test-Driven development embrace this truth ! Errors introduce transparency

Slide 55

Slide 55 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK STATUS CODES Status codes map to errors pick a meaningful subset of the 70+ status codes 200 - OK 
 201 - Created
 304 - Created - Not Modified
 400 - Bad Request 
 401 - Unauthorized
 403 - Forbidden
 404 - Not Found
 500 - Internal Server Error
 https://blog.apigee.com/detail/restful_api_design_what_about_errors

Slide 56

Slide 56 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK DESCRIPTIVE ERRORS Send meaningful errors along with status codes https://blog.apigee.com/detail/restful_api_design_what_about_errors { "message": "authentication failed", "errors": [ { "resource": "Issue", "field": "title", "code": "missing_field" } ] } { "type": "authentication", "message": “the username and password provided are invalid” , "status": “401” }

Slide 57

Slide 57 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK DESCRIPTIVE ERRORS application/vnd.error+json & application/vnd.error+xml https://github.com/blongden/vnd.error { "logref": 42, "message": "Validation failed", "_links": { "help": { "href": "http://.../", "title": "Error Information" }, "describes": { "href": "http://.../", "title": "Error Description" } } }

Slide 58

Slide 58 text

Demonstration Handling errors with vnd.errors and @ControllerAdvice

Slide 59

Slide 59 text

Demonstration Using @ControllerAdvice

Slide 60

Slide 60 text

T H E S P R I N G R E S T S TA C K API Versioning

Slide 61

Slide 61 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK VERSIONING YOUR API Build a version into your API ! API versions can be dealt with one of two ways: through API URIs: https://api.foo.com/v1 through media types: application/vnd.company.urapp-v3+json

Slide 62

Slide 62 text

T H E S P R I N G R E S T S TA C K Security

Slide 63

Slide 63 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING SECURITY Security is hard. Don’t reinvent the wheel! ! Things to worry about when developing web applications? EVERYTHING ! (cross-site scripting, session fixation, identification, authorization, and authentication, encryption, and SO much more.)

Slide 64

Slide 64 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING SECURITY Spring Security is a modern security framework for a modern age ! Authentication is valid? Authentication Mechanism collects the details client submits authentication credentials Store Authentication in SecurityContextHolder No - retry! Yes process original request

Slide 65

Slide 65 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING SECURITY Spring Security is a modern security framework for a modern age ! Authentication is valid? Authentication Mechanism collects the details client submits authentication credentials Store Authentication in SecurityContextHolder No - retry! Yes process original request Authentication Mechanism collects the details! ! AuthenticationRequest is sent to AuthenticationManager! ! (passes it through a chain of AuthenticationProviders)! ! AuthenticationProvider asks a UserDetailsService for a UserDetails! ! The UserDetails object is used to build an Authentication object! ! !

Slide 66

Slide 66 text

Demonstration adding a Spring Security sign in form to a regular application ! !

Slide 67

Slide 67 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SECURING REST SERVICES Usernames and Passwords ! If you can trust the client to keep a secret like a password, then it can send the password using: 
 ...HTTP Basic - passwords are sent plaintext! ... HTTP Digest - hashed passwords, but still plaintext. 
 SSL/TLS encryption helps prevent man-in-the-middle attacks

Slide 68

Slide 68 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SSL AND TLS So, SSL/TLS is...? ! an implementation of public key cryptography: ! ! ! public key cryptography only works because we all agree to trust well known root CAs so trust! wow

Slide 69

Slide 69 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SSL AND TLS SSL/TLS is used routinely to verify the identify of servers. ! Normally, the client confirms the server, but the server rarely requires the client to transmit a certificate. ! It’s easy enough to setup SSL/TLS on your web server. !

Slide 70

Slide 70 text

Demonstration Setting up SSL/TLS with embedded Apache Tomcat 7 and Spring Boot ! !

Slide 71

Slide 71 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SSL AND TLS SSL/TLS can be used to identify the client to the server, through mutual authentication. ! ! browser/client must send their certificate, as well. @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .and() .x509(); }

Slide 72

Slide 72 text

@Configuration @EnableWebMvcSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { ! @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth. inMemoryAuthentication() .withUser("mia").password("password").roles("USER").and() .withUser("mario").password("password").roles("USER","ADMIN"); } ! @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .and() .x509(); } }

Slide 73

Slide 73 text

Demonstration X509 Java configuration demo ! !

Slide 74

Slide 74 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK THE TROUBLE WITH PASSWORDS Tim Bray says: Passwords don’t scale ! Too easy to compromise. ! Updating all your clients whenever you change your password would be a nightmare! !

Slide 75

Slide 75 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK THE TROUBLE WITH PASSWORDS

Slide 76

Slide 76 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK X-AUTH Most people just want their own clients to be able to talk securely to their own services. ! x-auth offers one way of achieving this based on tokens ! !

Slide 77

Slide 77 text

Demonstration A custom x-auth example

Slide 78

Slide 78 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK OAUTH OAuth is a way for one (automated) process to securely identify itself to another ! Assumes a user context: ! “I authorize $CLIENTX to act on $USER_Y’s behalf” ! OAuth is a way of authorizing a client with particular access (scopes) !

Slide 79

Slide 79 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK OAUTH

Slide 80

Slide 80 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK OAUTH

Slide 81

Slide 81 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK OAUTH

Slide 82

Slide 82 text

Demonstration Spring Security OAuth in the oauth module

Slide 83

Slide 83 text

Demonstration Writing a unit test for an OAuth service using the Spring MVC test framework

Slide 84

Slide 84 text

T H E S P R I N G R E S T S TA C K The Connected Web of APIs

Slide 85

Slide 85 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK A CONNECTED WORLD IN 60 SECONDS 3125 photos uploaded 7630 messages sent 7610 searches 2MM videos viewed 2000 checkins 175k tweets 1090 visitors 700k messages sent * source: visual.ly/60-seconds-social-media A Connected World in 00:60 seconds

Slide 86

Slide 86 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING SOCIAL Spring Social provides an authentication and 
 authorization client for OAuth (1.0, 1.0a, 2.0) ! Provides type-safe API bindings for various services

Slide 87

Slide 87 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK • Body Level One Body Level Two Body Level Three Body Level Four Body Level Five BINDINGS... SPRING SOCIAL BINDINGS

Slide 88

Slide 88 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK SPRING SOCIAL BINDINGS

Slide 89

Slide 89 text

Demonstration Using Spring Social in an Application

Slide 90

Slide 90 text

Demonstration Building Your own Spring Social binding

Slide 91

Slide 91 text

T H E S P R I N G R E S T S TA C K Deployment

Slide 92

Slide 92 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK MICRO SERVICE ARCHITECTURE Micro Services ... ! Promote single responsibility principle ! Promote loosely coupled, focused services. (SOLID at the architecture level) ! Don’t like it? Throw it away! In object-oriented programming, the single responsibility principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.! * * http://en.wikipedia.org/wiki/Single_responsibility_principle

Slide 93

Slide 93 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK EMBEDDED WEB SERVERS Spring Boot supports Apache Tomcat 7 by default. ! Easy to switch to Jetty, or Tomcat 8

Slide 94

Slide 94 text

Demonstration Switching embedded web servers

Slide 95

Slide 95 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK TRADITIONAL/CLASSIC SERVERS

Slide 96

Slide 96 text

Demonstration From fat .jar to .war

Slide 97

Slide 97 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK REST DESIGN WITH SPRING SPRING WORKS WELL IN THE CLOUD CLOUD

Slide 98

Slide 98 text

Demonstration To the cloud!

Slide 99

Slide 99 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK PRODUCTION READY REST Spring Boot is production-ready, by default ! Comes out of the box with smart monitoring and management tools, the CrashD server, etc. ! ! !

Slide 100

Slide 100 text

Demonstration production ready REST services with Boot

Slide 101

Slide 101 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK NEXT STEPS Spring IO Guides http://spring.io/guides ! Roy Fielding’s Dissertation introduces REST http://www.ics.uci.edu/~fielding/pubs/dissertation/evaluation.htm#sec_6_1%7C ! The Spring REST Shell http://github.com/jbrisbin/rest-shell ! Spring Security, Security OAuth, Spring Data REST, HATEOAS, Social http://github.com/spring-projects ! Spring MVC Test Framework http://docs.spring.io/spring/docs/4.0.x/spring-framework-reference/html/testing.html !

Slide 102

Slide 102 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK NEXT STEPS Oliver Gierke’s talk on Hypermedia from Øredev 
 @ http://vimeo.com/53214577 
 Lez Hazelwood’s talk on designing a beautiful JSON+REST API 
 Ben Hale’s talk on REST API design with Spring from SpringOne2GX 2012 
 @ http://www.youtube.com/watch?v=wylViAqNiRA 
 My links: github.com/joshlong/the-spring-rest-stack slideshare.net/joshlong/rest-apis-with-spring @starbuxman !

Slide 103

Slide 103 text

GITHUB.COM/JOSHLONG/THE-SPRING-REST-STACK REST DESIGN WITH SPRING github.com/joshlong/the-spring-rest-stack @starbuxman [email protected] slideshare.net/joshlong github.com/joshlong speakerdeck.com/joshlong