Spring Assembly Core Notes

Source: Internet
Author: User

(1) Automatic assembly

Turn on Componentscan (automatic scanning) by using the annotation @component in the class (the default bean ID is the first character of the class name lowercase), using @autowired to implement the automatic assembly of attributes, constructors, member functions. @Qulifer annotations explicitly specify the ID of the bean to resolve ambiguity.

(2) Javaconfig Assembly

@Configuration annotations are indicated for the configuration class.

@Bean display the declared Bean ID defaults to the first character of the method name lowercase. You can modify the ID name by using the Name property.

@Spring intercepts all method calls labeled @bean, ensuring that the bean returned by the method is not actually called every time.

(3) XML assembly

Spring Assembly Core Notes

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.