Spring Boot Hello Application Example

In this post we will learn how to create spring boot application/project . Now we are going to create our first spring boot application example.  Follow below steps

Step 1.  Firstly we will create java spring boot project using  https://start.spring.io/ website . For create new spring boot project click on Here . I am select maven project with java and spring boot2.1.3 . After that  Fill  Group  , Artifact details and click generate project .


Step 2:  After Click Generate project button it will download java spring boot  project for you. Now you extract this zip and import in eclipse . After import java spring boot project in eclipse , application structure such as.


package com.jp.helloWorld;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class HelloWorldApplication {

	public static void main(String[] args) {
		SpringApplication.run(HelloWorldApplication.class, args);



Now we will create one rest controller which consume request and produce response for us.


package com.jp.helloWorld.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

public class HelloController {

	public String getApplicationName(){
		return "Application api call succsfully";


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
		<relativePath/> <!-- lookup parent from repository -->
	<description>Demo project for Spring Boot</description>







Now run application by run HelloWorldApplication.java as java project and open url in your browser or any rest client http://localhost:8080/app , you will got response of your api as.

You can download this project from here  SpringBootHelloAPplication



Leave a Reply

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

+ 33 = 36