How to use springBoot annotations
This article mainly introduces how to use springBoot annotations, the article is very detailed, has a certain reference value, interested friends must read it!
Introduction
SpringBoot is bred by the spring family based on efficient development, simplifying the initial construction of spring applications and complicated configuration in the development process. It is characterized by: silly development, reducing a lot of configuration, so that low-level developers can also participate in the development and writing of business logic, greatly reducing the degree of difficulty. The following is a detailed description of the use of common annotations in SpringBoot projects:
Notes commonly used in Springboot
1. @ Service
Used to annotate business layer components, indicating that a bean is defined
4. @ Component
Components in general, usually used for custom classes, need to be managed by spring, and we can use this annotation to annotate them. If bean is found in the scan.
8.Bean, which is equivalent to putting it on top of a method, rather than a class, means that when generating a Bean elimination through the use of @ Autowired, you can use @ Resource (name= "name", type= "type").
Without parentheses, the assembly is carried out by default according to the name, which can be specified through the name attribute and the type can be specified by type.
The above is all the content of this article "how to use springBoot Notes". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!