Spring MVC 1-0-1

In spring MVC, the model is a simple map encapsulated in the Model or ModelAndView classes of Spring MVC. It can come from a database, files, external services, and so on. It is up to you to define how to fetch the data and put it into the model. The recommended way of interacting with the data layer is through Spring Data libraries: Spring Data JPA, Spring Data MongoDB, and so on. There are a dozen projects related to Spring Data and I encourage you to take a look at http://projects.spring.io/spring-data.

The controller side of Spring MVC is handled through the use of the @Controller annotation. In a web application, the controller's role is to respond to HTTP requests. Classes annotated with the @Controller annotation will be ...

Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.