Restful Web Service Using Spring Boot
Learn to build RESTful web services using spring boot. Know the difference between @Controller and @RestController annotation.
Objective
In the section on database integration, we have exposed two additional business capabilities in the application
- Add a club
- Search for a club
However, to make that feature usable we need to expose the rest endpoint. In this lesson, we will learn how to expose the RESTweb service using the Spring Framework and key annotation provided by it to enable the RESTprinciple.
How to do it?
Add required dependency
As per the philosophy of spring boot we need to identify and add the required dependency.
By now, we already know that dependency has to be added because we have used it in our Billionaire’s Club and Elite Club application. Yes, it’s a starter web dependency.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifa
...