Skip to content

Commit

Permalink
add: SpringBoot
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwanga committed Oct 7, 2024
1 parent 38f3097 commit b95050e
Show file tree
Hide file tree
Showing 6 changed files with 687 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Spring/Spring6.md
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ public Object objectDemo02(@Qualifier("userDao") UserDao userDao,
public class ApplicationContextConfig {}
```

* @Configuration注解标识的类为配置类,替代原有xml配置文件,该注解第一个作用是标识该类是一个配置类,第 二个作用是具备@Component作用
* @Configuration注解标识的类为配置类,替代原有xml配置文件,该注解第一个作用是标识该类是一个配置类,第二个作用是具备@Component作用。这个注解还有一个更加强大的功能,它可以保障配置类中使用方法创建的bean的唯一性,为@Configuration注解设置proxyBeanMethods属性值为true即可,此属性默认值为true。注意,必须使用spring容器对象调用此方法才有保持bean唯一性的特性。

* @ComponentScan 组件扫描配置,替代原有xml文件中的 `<component-scan>`

Expand Down
Loading

0 comments on commit b95050e

Please sign in to comment.