Creating “Hello World “Spring Boot Project with STS and Maven Part 1
Jul 18, 2021
1. Download the Spring STS tools
Link : https://spring.io/tools and extract it to run
2. Start new Spring Started Project
Enter the name and select the project location, and check if version of java is same as the java version you have installed
3. Explore the Project
4. Creating a new Package
Inside main/java right click to create a new package
5. Under the Newly created package create a new class
And add the following code
package com.example.demo.sts.apiendpoint;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;
@RestControllerpublic class DemoSTSEndpoint {@RequestMapping("/")public String hello(){return "Hello World";}}
Start the Project
Output :
headover to localhost:8080/