首页 > 编程语言 > 详细

spring - 第N篇 一些笔记

时间:2019-09-07 14:37:58      阅读:78      评论:0      收藏:0      [点我收藏+]

1、properties文件的引入

<bean id="propertyConfigurer" 
         class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
         <property name="locations" value="mail.properties"/>
    </bean>
    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
       <property name="host" value="${mail.host}"/>
       <property name="username" value="${mail.user}"/>
       <property name="password" value="${mail.pwd}"/>
    </bean>

或者
<bean name="propertyConfigurer"  
   class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">  
   <property name="locations">  
      <list>  
         <value>classpath:mail.properties</value>
      </list>  
   </property>  
</bean>

2、

spring - 第N篇 一些笔记

原文:https://www.cnblogs.com/ZeroMZ/p/11480522.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!