springboot(4)之导入配置文件、配置类、占位符表达式

springboot默认是不支持手动装配的 自动装配 需要在主开始类中添加@ImportResource(locations={“classpath:spring.xml”}) 这样就可以识别到自己写的spring等配置文件 一般都不建议写配置文件 配置文件有两种方法:注解配置,xml配置 一般使用注解配置` 方法名相当于bean的名字 返回值相当于bean的类型 `springboot全局变量中
相关文章
相关标签/搜索