Spring Boot Hello World Example

In this Article, you will learn how to setup and start first Spring boot Example.
we are using here annotations for creating a simple application.
below are prerequisites you need to setup spring boot application in your local.
1.Java 1.7
2.Eclipse OxyGen
3.Spring
4.Maven

Below is the Pom.xml

1. we need below dependencies to have parent version spring boot

 

2.this entry for to have your application become web application which internally has tomcat

Source and target of java we can have an entry under  maven compiler plugin

Below is full Pom.xml

you can run above pom.xml in eclipse using run as maven  or else you can use the command prompt

 

Next Write HelloWorld.java which display the Hello world message in the browser

in above controller, @RestController will expose the hello method when  user clicks on “/” path in the browser

@EnableAutoConfiguration will configure automatically with all spring boot features in you application

 

after run your application in your application run as a java application , you will see below message in the console

Out will be like below when you  click on url browser http://localhost:8080/

Source Code Down load here FirstSpringBootExample.zip

 

Posted in springboot and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *