1、通过spring配置properties文件
其中class为自己定义的类
2、自定义类CustomizedPropertyPlaceholderConfigurer
这样就可以通过CustomizedPropertyPlaceholderConfigurer类来获取properties属性文件中的内容了
3、如何获取属性文件的内容
String host = (String) CustomizedPropertyPlaceholderConfigurer.getContextProperty("mail.smtp.host");