本站首页    管理页面    写新日志    退出


«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告

戒除浮躁,读好书,交益友


我的分类(专题)

日志更新

最新评论

留言板

链接

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


阅读全文(5478) | 回复(2) | 编辑 | 精华
 


回复:深入浅出 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 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144799580 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号