<bean id="velocityEngine"
class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
<property name="velocityProperties">
<props>
<prop key="resource.loader">class</prop>
<prop key="class.resource.loader.class">
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
</prop>
<prop key="velocimacro.library" />
<!-- <prop key="file.resource.loader.path">WEB-INF</prop> -->
</props>
</property>
<!-- --><property name="resourceLoaderPath" value="/WEB-INF"></property>
</bean>
<bean id="mailSender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host">
<value>smtp.gmail.com</value>
</property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.timeout">25000</prop>
<prop key="mail.smtp.socketFactory.port">465</prop>
<prop key="mail.smtp.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.smtp.socketFactory.fallback">false</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
</props>
</property>
<property name="username">
<value>aaa@gmail.com</value>
</property>
<property name="password">
<value>123456</value>
</property>
</bean>
<bean id="emailNotification"
class="com.web.util.email.EmailNotificationImpl">
<property name="javaMailSender" ref="mailSender" />
</bean>
<bean id="emailMessageProducer"
class="com.web.util.email.EmailMessageProducerImpl">
<property name="velocityEngine" ref="velocityEngine" />
</bean>
spring集成velocity
最新推荐文章于 2022-08-25 14:19:49 发布