On Sun, Nov 15, 2009 at 2:22 PM, Jonhy Pear <jonhy.p...@gmail.com> wrote:
> I have configured Spring Email to send emails to users.

Spring email buys almost nothing, if that's the only thing you use
Spring for, you could just as well use Velocity and plain javamail
directly (or alternatively chenillekit-mail).

>    <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/... ?

Reading from src/main/resources is not what you want. Maven copies
files in src/main/resources to classes/, so you want read the
templates from your classpath. Here's my corresponding direct Velocity
configuration (which works):
                Velocity.setProperty(Velocity.RESOURCE_LOADER, "classpath");
                Velocity.addProperty("classpath.resource.loader.class",
ClasspathResourceLoader.class.getName());
                Velocity.init();

So I assume the problem is simply that the value of resource.loader
should be "classpath", not "class".

Kalle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to