January 2018
Intermediate to advanced
414 pages
10h 29m
English
In our example, we have created a controller using the Spring annotation @RestController. This controller will be picked up by the component scan, at the application startup and will be added to our Spring context as a bean, as we understood in Chapter 2, Getting Started with Spring Boot 2.0.
In this controller, we have set a mapping using @RequestMapping, for the URL /customer, to accept GET requests. Since it is a RestController , the response will output as a JSON Object.
This mapping will be autoconfigured by Spring Boot and wired into our web application. If we check our application log when we start the microservice, we can see, among other messages:
s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/customer],methods=[GET]}" ...Read now
Unlock full access