sasi86 / SpringBoot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpringBoot

Spring Boot makes it ways to create stand-clone, production-grade Srping based Applications that you can "just run".

Drawbacks of Spring

  1. Huge framework
  2. Multiple setup steps
  3. Multiple configuration steps
  4. Multiple build and deploy steps

#Learn @

https://www.youtube.com/watch?v=99Nw2smMTLg&index=3&list=PLqq-6Pq4lTTbx8p2oCgcAQGQyqN8XeA1x https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/

#Creating Spring Boot Project - create simple maven jar project

  1. Add spring-boot-starter-parent as a parent of your pom
org.springframework.boot spring-boot-starter-parent 1.5.1.RELEASE
  1. To enable it as a web project add. This downloads comman jars like tomcat,log4j...
org.springframework.boot spring-boot-starter-web
  1. Run the Application.Create a class with main method.

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

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

SpringApplication.run does the following: .Setsup the default configuration. .Starts Spring application context. .Performs classpath scan. .starts Tomcat server.

About