constract和 property的写法

<beansprofile="test,local">-->

<!--&lt;!&ndash;本地,测试环境的mail服务配置&ndash;&gt;-->

<!--<beanname="sendMailService"class="cn.focus.dc.app.xinfang.service.SendMailService">-->

<!--<constructor-argindex="0"-->

<!--type="org.apache.velocity.app.VelocityEngine"-->

<!--ref="velocityEngine"/>-->

<!--<constructor-argindex="1"-->

<!--type="org.springframework.mail.javamail.JavaMailSender"ref="mailSender"/>-->

<!--<constructor-argindex="2"type="java.lang.String"-->

<!--value="${mail.from}"/>-->

<!--</bean>-->

<!--</beans>-->

<!--SCE测试环境及正式环境下mail服务配置-->

<beanname="sendMailService"class="cn.focus.dc.app.xinfang.service.SendMailService">

<constructor-argindex="0"type="org.apache.velocity.app.VelocityEngine"

ref="velocityEngine"/>

<propertyname="from"value="****@sohu-inc.com"/>

</bean>

@Autowired

privateVelocityEnginevelocityEngine;

privateStringfrom;

publicSendMailService(){

}

publicSendMailService(VelocityEnginevelocityEngine){

this.velocityEngine=velocityEngine;

}

publicSendMailService(Stringfrom){

this.from=from;

}

相关推荐