Spring MVC:在xml配置文件中混淆密码

时间:2015-11-03 17:18:47

标签: xml spring-mvc encryption

我想在XML配置文件中对BD密码进行模糊处理,保护或加密。有没有办法做到这一点?

<beans:bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"
    destroy-method="close">
    <beans:property name="driverClassName" value="org.postgresql.Driver" />
    <beans:property name="url" value="jdbc:postgresql://localhost:5432/myApp" />
    <beans:property name="username" value="postgres" />
    <beans:property name="password" value="p@ssw0rd" /> -- This is the one I want to encrypt.
</beans:bean>

0 个答案:

没有答案