首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

constract跟 property的写法

2013-09-08 
constract和 property的写法beans profiletest,local--!--!&ndash 本地,测试环境的 mail 服务配

constract和 property的写法
<beans profile="test,local">-->
    <!--&lt;!&ndash; 本地,测试环境的 mail 服务配置 &ndash;&gt;-->
    <!--<bean name="sendMailService" />-->
    <!--<constructor-arg index="1"-->
    <!--type="org.springframework.mail.javamail.JavaMailSender" ref="mailSender" />-->
    <!--<constructor-arg index="2" type="java.lang.String"-->
    <!--value="${mail.from}" />-->
    <!--</bean>-->
    <!--</beans>-->


        <!-- SCE 测试环境及正式环境下 mail 服务配置 -->
        <bean name="sendMailService" type="org.apache.velocity.app.VelocityEngine"
                             ref="velocityEngine"/>
            <property name="from" value="****@sohu-inc.com"/>
        </bean>

@Autowired
    private VelocityEngine velocityEngine;

    private String from;

    public SendMailService() {
    }

    public SendMailService(VelocityEngine velocityEngine) {
        this.velocityEngine = velocityEngine;
    }


    public SendMailService(String from) {
        this.from = from;
    }

热点排行