You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Will Glass-Husain <wg...@forio.com> on 2005/03/03 17:35:50 UTC

Re: Creating objects in template using "new" keyword

(moving to velocity-dev from velocity-user)

Just a quick note:

I'm not sure we should encourage people to call Class.newInstance() or 
getClassLoader() in a velocity template.  I'd like to see this capability go 
away (or at least be prevented by default in the future).  Seems 
counterproductive to encourage users to rely on it.  (although I appreciate 
that Shinobu's note emphasized the alternatives).

Best,
WILL

----- Original Message ----- 
From: "Shinobu Kawai" <sh...@gmail.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, March 02, 2005 10:33 PM
Subject: Re: Creating objects in template using "new" keyword


> Or, you can call Class#newInstance from anywhere.
> See Will's HackingVelocity power point about how to do this.
>  http://wiki.apache.org/jakarta-velocity/HackingVelocity
> ## Under "An Evil Velocity Template"
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Creating objects in template using "new" keyword

Posted by Nathan Bubna <nb...@gmail.com>.
On Thu, 3 Mar 2005 08:35:50 -0800, Will Glass-Husain <wg...@forio.com> wrote:
> (moving to velocity-dev from velocity-user)
> 
> Just a quick note:
> 
> I'm not sure we should encourage people to call Class.newInstance() or
> getClassLoader() in a velocity template.  I'd like to see this capability go
> away (or at least be prevented by default in the future).  Seems
> counterproductive to encourage users to rely on it.  (although I appreciate
> that Shinobu's note emphasized the alternatives).

agreed. in fact, i'd like to see us not encourage or support the
creation of arbitrary classes within templates *at all.*  that's why
ToolLoader is deprecated and will soon be abolished entirely.  if
people want to provide their own tools to hang themselves, that's
fine.  but i'd rather not see Velocity or VelocityTools helping them
out.

> Best,
> WILL
> 
> ----- Original Message -----
> From: "Shinobu Kawai" <sh...@gmail.com>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Wednesday, March 02, 2005 10:33 PM
> Subject: Re: Creating objects in template using "new" keyword
> 
> > Or, you can call Class#newInstance from anywhere.
> > See Will's HackingVelocity power point about how to do this.
> >  http://wiki.apache.org/jakarta-velocity/HackingVelocity
> > ## Under "An Evil Velocity Template"
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org