1.编写xml配置文件
2.创建Config类,添加@Configuration、@ImportResource注解,@ImportResource可以传入多个值
@Configuration
@ImportResource(locations= {"classpath:application-bean.xml"})
public class Config {
}
1.编写xml配置文件
2.创建Config类,添加@Configuration、@ImportResource注解,@ImportResource可以传入多个值
@Configuration
@ImportResource(locations= {"classpath:application-bean.xml"})
public class Config {
}
本文标题:Springboot下使用XML配置bean
本文链接:https://www.haomeiwen.com/subject/hmosshtx.html
网友评论