Build a Spring Boot Web Service Application

Download a Template

Go to https://start.spring.io/ and set the project metadata you want. I am going to use Gradle, Java 11, and Spring Boot 2.4.5 for project initialization. Click “GENERATE” to get the project skeleton. A “demo.zip” should be downloaded.

Open with VS Code and Setup the IDE for Spring Boot

You may unzip the project into any folder you want and open it with VS Code.

Develop the Application

First, we set up the build.gradle for importing the packages we needed. Replace the implementation org.springframework.boot:spring-boot-starter to be org.springframework.boot:spring-boot-starter-web

package com.mhho.demo.model;public class Post {    private String postId;    private String postBody;}

End?

This is a brief introduction to Spring Boot Web Service application. You can do a lot more with the framework and we will use this project as the base project for other stories.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store