You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Bartek Walter <Ba...@man.poznan.pl> on 2002/05/01 11:50:04 UTC

Re: using VelocityHtmlEmail outside web-app


Anmol Khanna wrote:
> 
> Hi,
> 
> I am using turbine 2.2 b 1 in *standalone* mode and am having troubles using VelocityHTMLEmail Class.
> 
> To create a new Instance of VelocityHtmlEmail RunData is required.

Try to use o.a.f.template.TemplateHtmlEmail instead, it requires Context
only.

> How do I obtain RunData?
> 
> I had a look at getRunData() method in RunDataFactory.
> 
> I can't use this method, because, I am not developing  a web-app  and don't have a request and response .
> 
> Are there any code samples of using VelocityHtmlEmail outside a web app?
> 
> When I create a VelocityHtmlEmail with RunData as null
> // RunData data =null; VelocityHtmlEmail ve = new VelocityHtmlEmail(data);
> 
> I get a NullPointerException  as method getContext assumes RunData !=null
> 
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.turbine.util.velocity.VelocityHtmlEmail.getContext(Velocit
> yHtmlEmail.java:271)
>         at org.apache.turbine.util.velocity.VelocityHtmlEmail.send(VelocityHtmlE
> mail.java:179)
>         at SendEmail.sendVelHTMLEmail(SendEmail.java:75)
>         at SendEmail.<init>(SendEmail.java:24)
>         at SendEmail.main(SendEmail.java:81)
> 
> Is it possible to use VelocityHtmlEmail outside a web app? (comments in the source code say that it is possible, but don't talk about  this problem)
> 
> Thanks
> Anmol

Bartek Walter


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>