How to obtain bean through spring Scan
By default, the component-scan label automatically scans packages in the specified path (including all sub-packages ), automatically registers classes with the @ Component, @ Repository, @ Service, and @ Controller labels to the spring container. Marking Spring's @ Required, @ Autowired, JSR250's @ PostConstruct, @ PreDestroy, @ Resource, JAX-WS's @ WebServiceRef, EJB3's @ EJB, JPA's @ persistenceContext, @ PersistenceUnit, and other annotation classes to make the annotation take effect (including the annotation-config label ). The key is how to obtain the default name of beangetBean managed by the spring container through scanning (the first letter is in lowercase). to customize the name, @ Service ("aaaaa ") in this way, specify. This type of bean is "singleton" by default. If you want to change it, you can use @ Scope ("prototype") to change it.