1. Spring boot introduction

What’s spring boot?

You can easily develop web applications using spring boot .

It provides default configuration and thus reducing lot of boilerplate code.

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run” as packaged jar file.

Ex. java -jar SampleApp.jar

Why spring boot?

Suppose you are using spring MVC to develop web application. You need to do lot of configurations for it such as datasource, transaction management, security, EntityManager etc. You have to define all dependencies required for the application.

 

But with the spring boot , you don’t need to worry about the configuration part. Also spring boot comes with all the dependencies

 

package com.myjavablog.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HelloWorldController {

@GetMapping("/")
public String getHomePage() {
return "index";
}
}

Advantages

  • It provides a radically faster and widely accessible ‘getting started’ experience for all Spring development
  • Its opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults
  • It provides a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration)
Bitnami