Spring Boot- Lets Get start

Spring Boot: In this article, we will talk about how a person will start working using spring boot. Most of the people don’t know what is spring boot( Check here )

Getting Start with Spring boot

Let start with very basic ,

Setting up the development environment

Spring boot can be used by any IDE but the recommended IDE for Spring boot is STS ( Spring Tool Suite ) Which is basically a customized Eclipse IDE have different inbuild plugin for Spring boot support.

Download from here

Prerequisites:

  • If you want to work on Spring boot , you should be familiar with Spring framework.
  • You should know the Java programming language.
  • You should have a hands on experience on Spring Annotations.

Resources to learn Spring boot

To learn Spring boot there are so many different sites , But I always recommend you to Always first read the Official Documentation of Spring boot.

Moreover you can always explore different sites and you tube lectures for spring and spring boot.

You can also refer udemy course , Some recommended courses are as below.

https://www.udemy.com/spring-boot-essentials/

https://www.udemy.com/spring-boot-tutorial-for-beginners/

There are some free course were also you can explore.

https://www.udemy.com/spring-boot-getting-started/

 

You can also use some sites to learn spring boot

Now lets create our first spring boot project

In this exercise

  • what we will do is to create one simple spring boot application where
    • We will show you how to create spring boot project.
    • How to run spring project as java application which will run embedded tomcat.
    • We will Show you the console of the topic to show once tomcat runs successfully.

Creating Project In STS IDE:

  1. We first create first spring boot project as below in eclipse
Figure1

Figure1: Creating New Project

2. Now we will set the project name as below

figure2

Figure2: Setting the project name

3. After this you will be able to see the project as below

Now when we see the Code of the Generated File it will looks like below

package com.example.demo;

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

@SpringBootApplication
public class FirstSpringBootProjectApplication {

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

@SpringBootApplication : This is one of the most important Annotation Which enable Spring boot application, It is the combination of below important annotations

@SpringBootApplication = @ComponentScan + @EnableAutoConfiguration

Running the Application

To Run the Application we just need to Run above class as Run as Java Application

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.2.RELEASE)

2018-05-24 23:44:17.383  INFO 11652 --- [           main] c.e.d.FirstSpringBootProjectApplication  : Starting FirstSpringBootProjectApplication on LAPTOP-OTUSTG0M with PID 11652 (C:\learnspringboot_workspace\FirstSpringBootProject\target\classes started by Noeik in C:\learnspringboot_workspace\FirstSpringBootProject)
2018-05-24 23:44:17.389  INFO 11652 --- [           main] c.e.d.FirstSpringBootProjectApplication  : No active profile set, falling back to default profiles: default
2018-05-24 23:44:17.435  INFO 11652 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@a263c2: startup date [Thu May 24 23:44:17 IST 2018]; root of context hierarchy
2018-05-24 23:44:17.966  INFO 11652 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-05-24 23:44:17.980  INFO 11652 --- [           main] c.e.d.FirstSpringBootProjectApplication  : Started FirstSpringBootProjectApplication in 0.928 seconds (JVM running for 1.566)
2018-05-24 23:44:17.983  INFO 11652 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@a263c2: startup date [Thu May 24 23:44:17 IST 2018]; root of context hierarchy

You will see the above log in your console.
You can also download the project from Github

Download Now

Hope this article would be helpful for you to understand some basics of Spring boot !!!
If you liked this article please share it with your friends and in your circle !!!

You may also like...

5 Responses

  1. stud says:

    I visited many weƅsites but the audіo quality for аᥙɗio songs existing аt this web page is really superb.

  2. royce says:

    Good day! This is my 1st comment here so I just wanted to give a quick shoᥙt
    out and say I ɡenuinely enjoy reading through your
    posts. Can you recοmmend any other blogs/weƅsites/forums that go
    օveг the same topics? Thank you so mᥙch!

  1. June 1, 2018

    […] Spring boot now a day is getting so much of popularity because of its quiet deployment and production ready code base feature. […]

  2. November 25, 2018

    […] Also learn: What is Spring boot Application? […]

Leave a Reply

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