Look at setting the file.resource.loader.path property http://static.springsource.org/spring/docs/2.5.6/reference/view.html#view-velocity-advancedconfig http://static.springsource.org/spring/docs/2.5.6/reference/view.html#view-velocity-advancedconfig
Andrew Jonhy Pear wrote: > > Hi! > > I have configured Spring Email to send emails to users. > > I want to use Velocity (not a requirement though, the only requirement is > to > have templating) to help me generate the body of the mail. > > I have a Tapestry service where I inject both VelocityEngine and > MailSender > services. > > Then, in the method sendRegistrationConfirmationEmail(User user) { > > ... > > String body = > VelocityEngineUtils.mergeTemplateIntoString(this.velocityEngine, > "UserRegistrationConfirm.vm", model); > > } > > I have my template UserRegistrationConfirm.vm in > src/main/resources/ under the same package as my service from where I use > velocity. > > However the template could not be found. > > I have in my applicationContext.xml the following configuration for > Velocity: > > > > <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> > </props> > </property> > </bean> > > Do you have any hint on how to tell velocity to lookup in > src/main/resources/... ? > > thank you, > > -- View this message in context: http://old.nabble.com/Tapestry-Resources-and-Velocity-Templates-tp26364177p26385154.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org