REST with Spring: Quick Start
I used Gradle to run “Hello, World” RESTful web service with Spring . Requirement JDK 1.8 or later Gradle 4+ 1. git clone & cd git clone https://github.com/spring-guides/gs-rest-service.git cd gs-rest-service/initial 2. add POJO src/main/java/com/example/restservice/Greeting.java package com.example.restservice; public class Greeting { private final long id; private final String content; public Greeting(long id, String content) { this.id = id; this.content = content; } public long getId() { return id; } public String getContent() { return content; } } 3. add controller src/main/java/com/example/restservice/GreetingController.java package com.example.restservice; import java.util.concurrent.atomic.AtomicLong; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController public class GreetingController { private static...