springboot must know will be

getting Started

Spring development history

  1. spring1.0 era
    practice of using xml files to configure in xml file to configure Bean, can easily be processed in the xml file, but in an increasing number of bena time, xml configuration also will be more complex Therefore, to solve alleviate xml file under more and more of the bean configuration process .spring2.0 was born

  2. spring2.0 era
    in the xml file to do a certain amount of optimization, so the configuration looks more and more simple, but language did not completely solve the problem of redundancy xml

  3. spring3.0 age;
    you can use java spring annotations provided to replace the problem once the xml configuration, it seems that we have forgotten what happened, spring has never been easier,

  4. spring4.0 age;
    4.0 times we do not even need the xml configuration file full use of java source code-level configuration with annotations spring provided can quickly develop. It has abandoned the form of xml configuration.

  5. springBoot;

    spring application, still can not change the operating mode Java Web applications, we still need to deploy to the war on Web Server, to provide services. Can you run a simple main () method will be able to start a Web Server do? Spring Boot meet this demand our

SpringBoot four core functions

Automatic Configuration

spring can automatically generate configuration you need, thanks to the introduction of new features Spring4.0 - conditioning configurations.

Conditions of configuration allows configuration exists in the application, but are ignored in this configuration to meet certain conditions before.

Custom Configuration

spring if the presence of a custom configuration, auto configuration will be ignored.

java source code configuration

This implementation also depends on the function of the conditions, then configure the specific implementation mainly @ConditionalOnMissingBean comment

External Configuration
  • External configured with priority
  • Bean applications available for injection configuration

Profile

Applications can use the configuration files of different configurations in different environments. Currently used profile is activated in the basic yml.

spring:
  profiles:
    active: {dev}
---
对应 bootstrap-{dev}.yml

Started dependence

  1. Using the transfer function is dependent loading maven other dependencies
  2. As with the general reliance, project dependencies (dependent child) can be excluded or specify a different version of the start-dependent (dependent parent)

Two properties reflect the springboot of automated and configurable characteristics

Spring Boot CLI

Actuator

Custom Configuration

Boot process

Guess you like

Origin www.cnblogs.com/hans-kl/p/11345702.html