You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Niall Gallagher <ni...@analog.com> on 2004/01/20 12:04:32 UTC

Usage Patterns

Hi,

I have a query relating to the use of the Velocity runtime 
functionality. Which of these are the recommended usage patterns:

Velocity.<method> or Runtime.<method>

RuntimeInstance.<method> or VelocityEngine.<method>

Also, regarding the VelocityServlet and the VelocityViewServlet, are 
there ever problems where more than one instance of this type is loaded 
into a Servlet container, for example if there is an attempt to set the 
file resource loader path a second time using static Velocity.<method> 
invocations.

Niall


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


Re: Usage Patterns

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Jan 20, 2004, at 6:04 AM, Niall Gallagher wrote:

> Hi,
>
> I have a query relating to the use of the Velocity runtime 
> functionality. Which of these are the recommended usage patterns:
>
> Velocity.<method> or Runtime.<method>
>
> RuntimeInstance.<method> or VelocityEngine.<method>

You should avoid using anything but Velocity or VelocityEngine.  This 
is due to evolution...

>
> Also, regarding the VelocityServlet and the VelocityViewServlet, are 
> there ever problems where more than one instance of this type is 
> loaded into a Servlet container, for example if there is an attempt to 
> set the file resource loader path a second time using static 
> Velocity.<method> invocations.

There is w/ VelocityServlet, as that uses the old singleton approach.  
I don't remember what VVS does.

-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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


Re: Usage Patterns

Posted by Nathan Bubna <na...@esha.com>.
Niall Gallagher said:
> I have a query relating to the use of the Velocity runtime
> functionality. Which of these are the recommended usage patterns:
>
> Velocity.<method> or Runtime.<method>
>
> RuntimeInstance.<method> or VelocityEngine.<method>
>
> Also, regarding the VelocityServlet and the VelocityViewServlet, are
> there ever problems where more than one instance of this type is loaded
> into a Servlet container, for example if there is an attempt to set the
> file resource loader path a second time using static Velocity.<method>
> invocations.

yes, there are.  http://issues.apache.org/bugzilla/show_bug.cgi?id=24574  the
VVS currently uses the singleton model.  the plan has been to change this
after 1.1 final.

Nathan Bubna
nathan@esha.com


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