第一步:
自定义类继承PropertyPlaceholderConfigurer,然后重写convertProperties()方法,代码示例如下:
public class DecryptPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer{
@Override
protected void convertProperties(Properties props) {
Enumeration propertyNames = props.propertyNames();
while (propertyNames.hasMoreElements()) {
String propertyName = (String) propertyNames.nextElement();
String propertyValue = props.getProperty(propertyName);
String convertedValue = convertPropertyValue(propertyValue);
if(propertyName.equals("jdbc.user")){
&nb