The Spring Framework and REST
It is assumed that the reader is familiar with the Spring Framework (referred to as Spring from here on). We will therefore focus on the specificities of building RESTful web services with Spring, in this section.
Since REST hinges on URIs, the Spring Web MVC framework provides all the necessary tools for building RESTful endpoints. Annotations, such as org.springframework.web.bind.annotation.RequestMapping
and org.springframework.web.bind.annotation.RequestParam
for mapping URLs and parameters form the basis for creating such endpoints. Chapter 3, The First Endpoint, will discuss these annotations and offer code samples to illustrate their use.
Note
Reference documentation about the Spring Web MVC can be found at http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html.
With the technological context laid out, let's now look at one such RESTful service. Throughout this book, we will be building a sample web service that helps manage hotels and B&Bs.