Creating a RESTful web service

In Spring Boot, all the HTTP requests are handled by controller classes. To be able to create a RESTful web service, first, we have to create a controller class. We will create our own Java package for our controller:

  1. Activate the root package in the Eclipse Project Explorer and right-click. Select NewPackage from the menu. We will name our new package com.packt.cardatabase.web:
  1. Next, we will create a new controller class in a new web package. Activate the com.packt.cardatabase.web package in the Eclipse project explorer and right-click. Select NewClass from the menu. We will name our class  CarController ...

Get Hands-On Full Stack Development with Spring Boot 2.0 and React 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.