摘要: Spring之ResourceLoader Spring中的ResourceLoader用于加载资源。可以从文件中、网络中、流中加载资源。 资源加载器是个接口,默认从类路径下加载。通过getResource方法从字符串中查找路径。可以从容器中获取ResourceLoader,调用getResourc 阅读全文
posted @ 2020-01-05 20:18 cgl_dong 阅读(554) 评论(0) 推荐(0) 编辑
摘要: Spring之Environment Spring在运行时的环境有多个选择,开发环境、测试环境、生产环境等。每个Environment中可以配置多个Property,这些Property可以自定义配置,配置信息可以注入Spring容器。 这种配置可以在xml中,也可以在javaConfig中。 我们 阅读全文
posted @ 2020-01-05 20:06 cgl_dong 阅读(1308) 评论(0) 推荐(0) 编辑
摘要: ​ Spring之Aware ​ Spring 中的Aware用于帮助bean获取Spring Bean获取Spring容器的功能。 如这些Aware: ApplicationContextAware//获取容器服务 BeanNameAware//获取BeanName ResourceLoaderA 阅读全文
posted @ 2020-01-05 20:04 cgl_dong 阅读(282) 评论(0) 推荐(0) 编辑