1 回答

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