springboot in brief

What is springboot

Spring Boot is a new framework provided by Pivotal team, which is designed to simplify the development process as well as the initial build new Spring applications. The framework uses a particular manner be configured so that the developer is no longer necessary to define the configuration of the template. I will say to understand, is the Spring Boot fact, what the new framework is not, it is the default configuration use a lot of framework, like Maven incorporates all the Jar package, Spring Boot incorporates all of the framework.

Environment Variables

1.JDK environment must be 1.8 or above
2. To use the Maven behind management tool 3.2.5 or later, it will introduce Maven installation and configuration
3. Development Tools recommends using IDEA, Eclipse can also

What are the benefits of using Spring Boot

SpringBoot disadvantages
advantages:
1. Create a separate Spring application
2. embedded Tomcat, without deploying the WAR file
3. Simplified Maven configuration
4. Spring autoconfiguration
5. The production-ready provide functions such as indicators, health check and external configuration
6 absolutely no code generation and no configuration requirements for XML
drawbacks:
1. If you do not agree with spring framework, perhaps this is the drawback.
2.SpringBoot characteristics
3. Create a separate project Spring
4. Built-in Tomcat and Jetty container
5. Provide a starter POMs to simplify Maven configuration
6. Provide a non-functional characteristics in common a series of large-scale projects, such as security, index, health detection, external configuration, etc.
7. The code generation and no xml configuration file

Project brief

1. Create a maven project

2.pom.xml

<?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">

    <modelVersion>4.0.0</modelVersion>

    <groupId>enjoy</groupId>

    <artifactId>springbootvip</artifactId>

    <version>1.0-SNAPSHOT</version>

    <parent>

        <groupId>org.springframework.boot</groupId>

        <artifactId>spring-boot-starter-parent</artifactId>

        <version>2.1.2.RELEASE</version>

    </parent>

    <dependencies>

        <dependency>

            <groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-starter-web</artifactId>

        </dependency>

    </dependencies>

</project>

3. outermost create application.java as a class project to start in your package directory
Here Insert Picture Description

package com;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.transaction.annotation.EnableTransactionManagement;

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

}

Such a simple springBoot project now created.

4. Create a controller class to test
Here Insert Picture Description

5. Start applecation.java start classes we created (spring-boot has a built-in tomcat, the default port is 8080), then start your browser to http: // localhost: 8080 / hellow on it

Published 10 original articles · won praise 0 · Views 289

Guess you like

Origin blog.csdn.net/weixin_44748475/article/details/104088928