Le jeudi 14 décembre 2006 à 21:17 +1100, David Elliot a écrit :
> Hi Claude,
> 
> Thank you very much, using template = super.getTemplate("x.vm")  fixes
> the problem (my custom resource loaders from velocity.properties work
> for the VVS... hurrah!).

Without Nathan's questions this wouldn't have come out... :-)

> Can you point me towards some documentation regarding why:
> 
>  template = Velocity.getTemplate("x.vm");
> 
> Is bad ??    It's a nasty trap for the newbies!!!
> 

When you make the static call Velocity.getTemplate(), you are using the
singleton model. When several instances of Velocity cannot share the
same configuration (for instance if they use different loaders), this
singleton model becomes unusable. That's why the good pratice is to keep
references on VelocityEngines rather than to initialize the static
Velocity object.

This is all explained here :

http://jakarta.apache.org/velocity/docs/developer-guide.html#To%20Singleton%20Or%20Not%20To%20Singleton...


  Claude

> 
> On 12/14/06, Claude Brisson <[EMAIL PROTECTED]> wrote:
> > That's probably the reason...
> >
> > template = super.getTemplate("x.vm") should be appropriate.
> >
> >   Claude
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to