Velocity 邮件模板在Spring 中发邮件报unable to find resource 'test.vm' in any resou的原因

<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>  
            </props>  
        </property>  
</bean>
看红色的部分,检查下.vm文件,是不是在class下!
result = VelocityEngineUtils.mergeTemplateIntoString(
                    velocityEngine, "mail.vm", model);

你可能感兴趣的:(apache,spring,velocity)