Beginner Spring Boot

Source: Internet
Author: User

1.Spring boot annotations

(1) @SpringBootApplication the Spring component scan and spring boot automatic configuration are turned on, in fact, @Spring Bootapplication is the combination of three annotations, the three annotations are

@Configuration, @ComponentScan, @EnanleAutoConfiguration, in earlier versions of spring, you need to use these three annotations on the class at the same time, but starting with spring Boot1.2.0, Just use the @springbootapplication, and we'll explain the role of the three annotations.

@Configuration: Indicates that the class uses spring Java-based configuration

@ComponentScan: Enable component scanning so that the Web control classes and other components that you write can be automatically discovered and registered as beans in the spring application context.

@EnanleAutoConfiguration: This humble little note can also be called @abracadabra, which is the same as configuring the spring boot to automatically configure the magic, so you don't have to write the configuration of the article.

Beginner Spring Boot

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.