项目中所有的源码都可以在此链接的仓库中找到:github.com/chenhaoxian…
文章目录
19.2.2 继承PropertySourcesPlaceholderConfigurer类进行解密处理
从前面可以知道PropertySourcesPlaceholderConfigurer和PropertyPlaceholderConfigurer都是可以来实现解决加密的问题的。
因为我们需要自己管理propertyConfigurer,所以需要我们将context:property-placeholder这个配置改为手动的方式配置Bean,如代码清单19-10所示。
spring引入数据库账号密码解密
代码清单19-10:spring引入数据库账号密码解密
<!-- 引入属性文件 classpath就是resource下-->
<!--<context:property