Add REST Controller to Spring Boot Application

In this post, we will see how to add REST controller to Spring Boot Application.
First you can create the Spring Boot Applicatin using Netbean IDE.

You can create the Java class FirstController in your Source Packages folder of the Netbeans IDE.

You can add the following code to Class you created

Now you can build and run the application.
Open the URL http://localhost:8080/hello and you will see “hello” in your browser