1 回答

慕后森
TA貢獻(xiàn)1802條經(jīng)驗 獲得超5個贊
可以擴(kuò)展Spring的PropertyPlaceholderConfigurer,摘錄別人一段代碼你參考
public class DecryptPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer{
/**
* 重寫父類方法,解密指定屬性名對應(yīng)的屬性值
*/
@Override
protected String convertProperty(String propertyName,String propertyValue){
if(isEncryptPropertyVal(propertyName)){
return DesUtils.getDecryptString(propertyValue);//調(diào)用解密方法
- 1 回答
- 0 關(guān)注
- 946 瀏覽
添加回答
舉報
0/150
提交
取消