论坛首页 入门技术论坛

spring集成velocity

浏览 2044 次
该帖已经被评为新手帖
作者 正文
   发表时间:2008-08-05  

<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>

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics