spring中为了减少xml中配置,可以创建一个配置类(例如exampleconfiguration)来对bean进行配置。
1、配置spring配置文件来启用java注解
2、定义一个配置类
3、说明
用@configuration注解的类,等价 与xml中配置beans;用@bean标注方法等价于xml中配置的bean。
spring中为了减少xml中配置,可以创建一个配置类(例如exampleconfiguration)来对bean进行配置。
1、配置spring配置文件来启用java注解
2、定义一个配置类
3、说明
用@configuration注解的类,等价 与xml中配置beans;用@bean标注方法等价于xml中配置的bean。