« | September 2025 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | | | | |
| 公告 |
戒除浮躁,读好书,交益友 |
Blog信息 |
blog名称:邢红瑞的blog 日志总数:523 评论数量:1142 留言数量:0 访问次数:9711702 建立时间:2004年12月20日 |

| |
[java语言]深入浅出 spring AOP (五) 原创空间, 软件技术
邢红瑞 发表于 2006/1/2 10:37:23 |
在spring的配置文件中,数据库密码是明文的,如何保护你的数据库密码,使用spring的MethodInvokingFactoryBean可以轻易做到。配置文件 <property name="password"> <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetClass" > <value>com.tatan.util.XxxUtil</value> </property> <property name="targetMethod"> <value>decryptPassword</value> </property> <property name="arguments"> <value>saflj</value> </property> </bean> </property>java类package com.tatan.util;
public class XxxUtil { public static String decryptPassword(String password) { return new String("Iamstupid"); }}注意 decryptPassword必须是static,参数可以是List,或Map |
|
回复:深入浅出 spring AOP (五) 原创空间, 软件技术
kruce(游客)发表评论于2006/9/5 14:08:32 |
MethodInvokingFactoryBean expose a bean that uses the singleton patter<bean name = "singleton" class = "org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="staticMethod"> <value>...</value> </property></bean> |
|
回复:深入浅出 spring AOP (五) 原创空间, 软件技术
z_j22(游客)发表评论于2006/1/11 15:54:51 |
|
» 1 »
|