PropertyConfigurer.java
package util; import java.util.Properties; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; public class PropertyConfigurer extends PropertyPlaceholderConfigurer { private static Properties property = null; private static final String JDBC_PASSWORD = "jdbc.password"; @Override protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException { try { String password = AESCodec.decrypt(props.getProperty(JDBC_PASSWORD)); props.setProperty(JDBC_PASSWORD, password); } catch (Exception e) { e.printStackTrace(); } property = props; super.processProperties(beanFactoryToProcess, props); } public static String get(String key) { return property.getProperty(key); } }