Spring MVC

34ecacd077244d141a23c46ea094df5c?s=47 Gerrit Meier
September 11, 2014

Spring MVC

Spring MVC as a part of the Spring ecosystem.

34ecacd077244d141a23c46ea094df5c?s=128

Gerrit Meier

September 11, 2014
Tweet

Transcript

  1. Spring MVC

  2. Gerrit Meier T-Systems on site services GmbH @meistermeier +GerritMeier

  3. Spring

  4. Context Data Social Integration … WebMVC

  5. Context Data Social Integration … WebMVC

  6. Spring Context

  7. Context Tourist sleep fun transport take my money

  8. Context Tourist sleep fun transport take my money Hotel ThemePark

    ShoppingMall Shuttle
  9. Context Tourist sleep fun transport take my money Camping WalkInThePark

    GarageSale Bike
  10. Context Demo

  11. Spring Data

  12. Data http://

  13. Data Demo

  14. Spring MVC

  15. DispatcherServlet Controller View(Template) WebMVC request response delegate render response rendered

    response attach data
  16. DispatcherServlet Controller View(Template) WebMVC request response delegate attach data render

    response rendered response
  17. DispatcherServlet Controller View(Template) WebMVC request response delegate render response rendered

    response attach data
  18. DispatcherServlet Controller View(Template) WebMVC request response delegate render response rendered

    response attach data model
  19. WebMVC @Controller public class UserController { ! @RequestMapping("/users") public String

    listUsers() { […] return "viewName"; } } http://server/myApp/users
  20. WebMVC @Controller @RequestMapping("/users") public class UserController { ! @RequestMapping public

    String listUsers() { […] return "viewName"; } } http://server/myApp/users
  21. WebMVC @Controller public class UserController { ! @RequestMapping("/users") public String

    listUsers( @RequestParam("filter") String filter) { […] return "viewName"; } } http://server/myApp/users?filter=hans
  22. WebMVC @RequestMapping( value = "/users/{id}") public String showUser( @PathVariable("id") Long

    id){ […] return "viewName"; } http://server/myApp/users/1
  23. WebMVC @RequestMapping( value = "/users/{id}", method = RequestMethod.GET) public String

    showUser( @PathVariable("id") Long id){ […] return "viewName"; } http://server/myApp/users/1
  24. WebMVC @RequestMapping(method = RequestMethod.POST) public String save(…) { […] return

    "viewName"; } POST http://server/myApp/users
  25. WebMVC @RequestMapping(method = RequestMethod.POST) public String save( @Valid User user,

    BindingResult bindingResult) { […] return "viewName"; } POST http://server/myApp/users
  26. WebMVC Accept: text/html ! ! ! ! ! Accept: application/json

    /users { users: [ {name: “Hans“} ] } User List ! - Hans http://…
  27. https://www.flickr.com/photos/roshanyadama/11915951346 https://creativecommons.org/licenses/by/2.0/

  28. WebMVC https://www.flickr.com/photos/mistermoss/3134331944 https://creativecommons.org/licenses/by/2.0/

  29. WebMVC

  30. WebMVC https://www.flickr.com/photos/bilal-kamoon/6835060992 https://creativecommons.org/licenses/by/2.0/