Springboot Official Document Introduction 2.0.0.M7

Source: Internet
Author: User
Tags spring boot actuator

Part 1 (1-7)

A short introduction to spring Boot that provides a quick-read map of the entire document, which makes it easy to find

Part 2 (8-12)

Start using

  • 8 Introduction of some advantages
  • 9 Environmental requirements
    • 9.1 Inline Web Container version
  • 10 Installation Manual
    • 10.1 Java Developer's installation manual
      • 10.1.1 Maven Installation Template
      • 10.1.2 Gradle Installation Template
    • 10.2 Using the Springboot CLI to install (do the project temporarily not considered)
    • 10.3 Upgrading the old version Springboot
  • 11 First Springboot Project step-by-step
    • 11.1 Step pom.xml How do I write this? Use the method that inherits the Spring-boot-starter-parent project's pom file, and then declare some dependencies on the warehouse and the plugin repository
    • 11.2 Adding dependencies to classpath the dependency management method that ignores the version number is described here because inheriting the Spring.io in the above Pom file will give us the most appropriate version.
    • 11.3 Writing the necessary Java code here are three annotations @RestController , @EnableAutoConfiguration @RequestMapping and a static method SpringApplication.run below to do a few simple explanations
      • 11.3.1 explains @RestController and @RequestMapping , these are both SPRINGMVC annotations.
      • 11.3.2 explains that @EnableAutoConfiguration this annotation is for springboot to guess how you would normally configure the bean based on your dependencies, such as adding a spring-boot-starter-web dependency, and automatically configuring a Web project with this annotation
        The next explanation is that all official starters are well-configured automatically, but not only the official starters can be automatically configured.
      • 11.3.3 explains the Main method here is the main method of the traditional Java program, by calling the Springapplication static method run to start the Springboot project
    • 11.4 Running a running project
    • 11.5 Packaged executable jar packs all classpath dependencies + source code, usually with Uber when not springboot, and can now be directly inside the POM
  • 12 What to Read Next
Part 3 and above are start-guide, here's how to get Started (13-22)
  • 13 Build Tool Ads
    • 13.1 Rely on management is to tell you springboot to help you manage most of the dependent version, you only need to declare the dependent version, Springboot will choose the appropriate version for you, because they have a BOM.
    • 13.2 Introduction to build a Springboot project with Maven first introduces some of the features provided by inheritance spring-boot-starter-parent, note: Placeholders are supported in the Spring configuration file (properties file or Yml file) ${...}, but Macen filtering uses @[email protected] placeholders, you can invoke the Maven property resource.delimiter to override the
      • 13.2.1 inheriting starter The specific code of the parent
      • 13.2.2 How to use Springboot without using the parent pom
      • 13.2.3 using spring Boot Maven Plugin to package the executable jar
    • 13.3 Gradle How to use springboot here directly posted the link, Spring Boot ' s Gradle plugin documentation
    • 13.4 Ant how to use
    • 13.5 Introduction Starters here also introduced the starter naming format (if you write starter words), divided into three categories to introduce the commonly used starters.
  • 14 How the code is organized
    • 14.1 Specification of the package structure do not declare the package, do not declare the package will cause all classes are under the "Default" package, which will cause the annotations to scan all class
    • 14.2 Main Application Class location if you use the recommended location, you can make the corresponding annotations exempt from configuration, or you need to configure the appropriate annotations
  • 15 Introduction to the configuration class Springboot support is configured with Java code, and the class that belongs to the configuration file needs @Configuration to be decorated
    • 15.1 Importing the additional configuration class configuration classes do not need @Configuration to be decorated with each one, you can also use @Import to bulk import the added configuration classes, and you can use @ComponentScan annotations to scan spring components, including configuration classes
    • 15.2 XML configuration
  • 16 automatic configuration only needs to add one @EnableAutoConfiguration to automatically consider configuring the @Configuration configuration class automatically
    • 16.1 Alternative Autoconfiguration If you configure your own bean in the configuration class, the automatically configured bean will be replaced (although some beans are written by themselves, spring does not know if it is the same, the substitution is only for common dependencies, so you still need to manually exclude it)
    • 16.2 excluding specific auto-configuration classes

      By defining the properties of the automatic configuration annotation, such as

      @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
  • Spring Beans and Dependency Injection use @ComponentScan annotations to scan corresponding packet discovery Beans, use @Autowired (constructor injection) to assemble beans automatically, and if you use the recommended structure to organize your code, you can eliminate the @ComponentScan configuration of annotation properties. If a bean has only one constructor, @Autowired you can omit the
  • 18 using @SpringBootApplication annotations with the @SpringBootApplication equivalent of simultaneous use, @Configuration @EnableAutoConfiguration and @ComponentScan These three annotations, annotations are configured as default, and the annotations also provide the right @EnableAutoConfiguration , @ComponentScan personalized Configuration
  • 19 Running the App
    • 19.1 running from the IDE, debugging
    • 19.2 packaging run for jar, debug
    • 19.3 using the Maven plugin to run, debug
    • 19.4 using the Gradle plugin to run, debug
    • 19.5 Hot Deployment The Springboot application is essentially a Java application, so its thermal deployment is essentially a hot deployment of the JVM, that is, replacing the corresponding bytecode at run time for hot deployment, and here's a perfect solution: JRebel. The solution provided by spring is spring-boot-devtools to implement a quick restarts-type thermal deployment
  • 20 developer tools, meaningspring-boot-devtoolsUse this tool to introduce dependencies first
    • 20.1 Default values for project properties Here there are some default properties such as SPRINGMVC provide HTTP caching, this cache can be application.properties configured in, the development of the time do not want the cache to be used, spring-boot-devtools will automatically apply the development-time configuration.
    • 20.2 Automatic Restart spring-boot-devtools will automatically restart the project, here also describes the conditions of automatic restart, and restart and reload technical differences, restart technology is implemented using two class loaders, The class loader used by the class being developed replaces the previous ClassLoader, and reload is the bytecode that reloads the class
      • 20.2.1 Changing the log configuration every time restart writes a log, here's how to close the log
      • 20.2.2 Exclude resource files Exclude restart directories that you do not need to follow
      • 20.2.3 not classpath file changes, how to restart
      • 20.2.4 Cancel Restart
      • 20.2.5 trigger file using the method trigger file, Trigger. Used to make the project restart under certain conditions, rather than changing a bit of the source code, this avoids the embarrassment of continually restart the project as it restart the IDE when compiling the files that are being written.
      • 20.2.6 Custom-made restart Classloader
      • 20.2.7 the restriction of using restart is to use spring instead of the object when deserializing ConfigurableObjectInputStream , and ObjectInputStream many third-party class libraries are deserialized when they are used context classloader , so there is a problem.
    • 20.3 Auto Refresh Page
    • spring-boot-devtoolsGlobal Settings for 20.4
    • 20.5 spring-boot-devtools can also operate on remote applications = = So hang
  • 21 Packaging for production environments
  • 22 This part is over, and the next thing to read
Part 4 Springboot characteristics (23-47)
  • display Banner+log at springapplication startup, very cool = ...
    • 23.1 startup failure prompt
    • 23.2 custom Banner
    • 23.3 Custom springapplication simply say that you use a specific springapplication to run
    • 23.4 Springapplication's builder-mode API
    • 23.5 application events and listeners some listener can be registered as beans, but this requires that the listener listener events occur after the ApplicationContext initialization is complete. If these listener cannot be configured as beans, you need to look here. The
    • 23.6 Web environment describes two types of ApplicationContext , annotationconfigapplicationcontext and Annotationconfigservletwebserverapplicationcontext
    • 23.7 Access Application arguments if you want to access the pass to springapplication.run (...) method, you can inject a org.springframework.boot.ApplicationArguments Bean to access the command-line options arguments.
    • 23.8 using Applicationrunner and Commandlinerunner on springapplication.run (...) After the method executes, let the program execute the code once. Implemented by implementing the Applicationrunner or Commandlinerunner interface. The difference is that the command-line options are accessed differently.
    • 23.9 Application exit Exit is also programmable
    • 23.10 Application management features
  • 24 external Configuration External configuration There are many ways, this section is more useful
    • 24.1 configuring random values This configuration facilitates testing
    • 24.2 accessing command-line properties
    • 24.3 Application Property File Springapplication will load these files and load the configuration intoEnvironment
    • 24.4 properties for a specific configuration (profile-specific)
    • 24.5 placeholders in attributes
    • 24.6 using Yaml instead of properties
      • 24.6.1 How to load Yaml, and the basic notation of YAML
      • 24.6.2 the way YAML exposes the environment to the properties
      • 24.6.3 Multi-Configuration Yaml documents a property can be configured multiple times in YAML depending on the specified configuration file that is active
      • The disadvantage of 24.6.4 Yaml is that it cannot be @PropertySource loaded with annotations
      • 24.6.5 Merge Yaml list is when the specified profile is active, the list with the same name as the specified configuration file is overwritten by the list in the default profile
    • 24.7 Type-Safe property configuration mainly describes @ConfigurationProperties the use of annotations, which can be used to eliminate @Value the cumbersome configuration of each property, and the two annotations there are other differences, and the configuration file can be registered as a bean, which are described in this section
      • 24.7.1 third-party configuration is the use of @bean annotations
      • 24.7.2 Loose Property bindings, property names do not necessarily match exactly
      • 24.7.3 property conversion, that is, the type conversion of a custom attribute
      • 24.7.4 @ConfigurationProperties validation, validation of attributes, such as verifying their non-null
      • 24.7.5 @ConfigurationProperties and @Value contrast @Value are functions within the core container, unlike type-safe (type-safe) configurations, with no loose binding and meta-data support, but with no spel expression support for the latter
  • 25 configuration file in front of the specified configuration file, this section provides a detailed description of the specified configuration file. Spring can separate configuration files so that different profiles work in a specific environment, such as a production environment where the configuration file works. @Profileannotations are used to annotate the current configuration class is that profile part. Use properties spring.profiles.active to specify which profile part is active.
    • 25.1 Adding an Active profile spring.profiles.active this project property adheres to the precedence rules of the property as do other properties
    • 25.2 Setting the configuration file API
    • 25.3 specifying the configuration file
  • 26th log
    • 26.1 format of the output log
    • 26.2 console output
      • 26.2.1 Console Output Color content
    • 26.3 log file output
    • 26.4 Log Levels
    • 26.5 Custom Log Configuration
    • 26.6 Logback Extension
  • 27 Developing Web Apps
    • 27.1 Spring WEB MVC Framework
      • 27.1.1 Spring MVC Automatic Configuration This is an automatic configuration provided by Springboot for SPRINGMVC
      • 27.1.2 HTTPMESSAGECONVERTERSSPRINGMVC using HttpMessageConverter interfaces to convert HTTP requests and responses
      • 27.1.3 Customizing the JSON serializer and the Deserializer
      • 27.1.4 Messagecodesresolver generates error codes to render error messages from the bound errors, Springboot has a default implementation
      • 27.1.5 Static Content
      • 27.1.6 Welcome Page
      • 27.1.7 Custom Icons
      • 27.1.8 Customizable Configurablewebbindinginitializer
      • 27.1.9 template engine This side of the note is useful----Note: IntelliJ idea sorts the classpath differently depending on how you run the app. Running the application through the main method in the IDE results in a different order than running with Maven, or gradle, or packaged jars, which may cause spring boot not to successfully find the template from Classpath. If you encounter this problem, you can re-order the classpath in the IDE, putting the class and resources of the module first. Alternatively, you can configure the module with a prefix of classpath*:/templates/, which will look for all template directories under Classpath.
      • 27.1.10 Error Handling
      • 27.1.11 Spring HATEOAS
      • 27.1.12 cross-domain resource sharing cors support
    • 27.2 Spring Webflux Frame
    • 27.3 Jax-rs and Jersey
    • 27.4 Inline servlet container support
      • 27.4.1 Servlets, Filters and listeners
      • 27.4.2 servlet Context Initialization
      • 27.4.3 Servletwebserverapplicationcontext
      • 27.4.4 Custom Inline servlet container
      • 27.4.5 limitations on JSP
  • 28 Safe
    • Support for 28.1 OAuth2
      • 28.1.1 Client
    • 28.2 Actuator Security
  • 29 Using relational databases
    • 29.1 Configuring DataSource
      • 29.1.1 supporting in-memory databases for internal embedded databases
      • 29.1.2 connecting the production environment database
      • 29.1.3 Connecting Jndi data sources
    • 29.2 using JdbcTemplate
    • 29.3 JPA and Spring Data
    • 29.4 using the H2 Web console
    • 29.5 using Jooq
  • 30 using NoSQL Technology
    • 30.1 Redis
      • 30.1.1 Connecting Redis
    • 30.2 MongoDB
      • 30.2.1 Connecting a MongoDB database
      • 30.2.2 mongotemplate
      • 30.2.3 Spring Data MongoDB repositories
      • 30.2.4 embedded in the MONGO
    • 30.3 neo4j Graph Database
    • 30.4 Gemfire a high performance distributed memory object cache system
    • 30.5 SOLR uses the Java-based full-text Indexing Service developed by Lucene; is a standalone enterprise Search application server; Lucene is an open source full-Text search engine toolkit, but it is not a full-text search engine, but a full-text search engine architecture. Provides a complete query engine and indexing engine, part of the text analysis engine.
    • 30.6 Elasticsearchelasticsearch is a Lucene-based search server. It provides a distributed multi-user-capable full-text search engine, based on a restful web interface.
    • 30.7 Cassandraapache Cassandra is a set of open source distributed database management system, mixed type non-relational database
    • 30.8 Couchbase is still a database
    • 30.9 Ldapldap (Lightweight Directory Access Protocol) is an open, neutral, industry-standard application protocol that provides access control and maintains directory information for distributed information through IP protocols.
    • 30.10 influxdb Time Series Database
  • Caching, Spring supports method caching
  • 32 Message Spring Framework provides strong support for inheriting message middleware (messaging systems)
    • The 32.1 JMSjavax.jms.ConnectionFactory interface provides a standard method for creating javax.jms.Connection, javax.jms.Connection for interacting with JMS agents (message middleware)
    • 32.2 AMQP Advanced Message Queuing Protocol (AMQP) is a platform-independent, line-level (wire-level) protocol for message middleware
    • 32.3 Apache Kafka (an open source messaging system)
  • 33 Invoking the remote Rest service byRestTemplate
  • 34 Invoking the remote Rest service byWebClient
  • 35 Verify that JSR-303 is a validation standard and that there are JSR-303 implementations (such as Hibernate validator) on the classpath, and the method validation attributes supported by the Bean Validation1.1 are automatically enabled. This allows the Bean method's parameters and/or return values to be labeled as javax.validation constraints. This means that the bean's method parameters and return values are validated
  • 36 Sending mail
  • 37 Handling distributed transactions using JTA
  • The hazelcasthazelcast makes it easier for Java programmers to develop distributed computing systems that provide distributed clustering and distributed cache services for a variety of applications running on a JVM-based environment: distributed, clustered services, network-formatted memory data, distributed cache, Elastic Scalable Service "
  • Quartz Schedulerquartz Scheduler, Scheduled Tasks.
  • Spring integrationspring Integration
  • Spring Session
  • 42 JMX-based monitoring and Management AVA Management Extensions (JMX) provide a standard mechanism for monitoring and managing applications. By default, spring boot will create a mbeanserver with the id ' mbeanserver ' and export any of the spring jmx annotations (@ManagedResource, @ManagedAttribute, @ managedoperation) of beans
  • 43 Testing
    • Dependencies within 43.1 test scope
    • 43.2 Testing the Spring application
    • 43.3 Testing Springboot Applications
    • 43.4 Test Tool Class
  • websocketsspring Boot for embedded tomcat (8 and 7), Jetty 9 and Undertow provide WebSockets auto-configuration
  • Web Services
  • 46 Creating your own auto-configuration This works better when developing the library.
  • What to Read Next
Part 5 Spring Boot Actuator

This section describes spring's support for monitoring and managing applications in the production environment.

Springboot Official Document Introduction 2.0.0.M7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.