You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Eung-ju Park <co...@isoft.co.kr> on 2001/01/13 14:36:12 UTC

How do I instantiate multiple velocity Runtime?

Hi.
Velocity successfully compiled with servlet 2.1 :-)
but I have another ugly question.
How do I instantiate multiple velocity Runtime?
I want to setup template file path per indivisual module which run on same
JVM.

PS. sorry for my buggy English. :-)
Please use easy English in reply for me.
Thanks. :-)


/"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
\ /   ASCII Ribbon Campaign  . Windows: "Where do you want to go today?"
X  - NO HTML/RTF in e-mail  . Linux: "Where do you want to go tomorrow?"
/ \ - NO Word docs in e-mail . BSD: "Are you guys coming or what?"



Re: How do I instantiate multiple velocity Runtime?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Eung-ju Park wrote:
> 
> Hi.
> Velocity successfully compiled with servlet 2.1 :-)
> but I have another ugly question.
> How do I instantiate multiple velocity Runtime?
> I want to setup template file path per indivisual module which run on same
> JVM

You should be able to use the web application class loader :

- put a velocity.jar into WEB-INF/lib for each app
- put your app-specific velocity.properties into your webapp tree
- specify the location of the app-specific properties file via web.xml
like 
 <servlet>
                <servlet-name>SampleServlet</servlet-name>
                <servlet-class>SampleServlet</servlet-class>
                <init-param>
                        <param-name>properties</param-name>
                        <param-value>velocity.properties</param-value>
                </init-param>
 </servlet>

I am playing with this now with both Tomcat4.0 and tomcat 3.2, and it
appears to work just fine. 

Anyone, let me know if I am wrong, as I am not 100% certain about this. 
The 2.2 spec doesn't appear to be lucidly clear about this....

> 
> PS. sorry for my buggy English. :-)
> Please use easy English in reply for me.
> Thanks. :-)

That's ok.  My Korean doesn't even compile... :)

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Re: How do I instantiate multiple velocity Runtime?

Posted by Jason van Zyl <jv...@periapt.com>.

On Sat, 13 Jan 2001, Eung-ju Park wrote:

> Hi.
> Velocity successfully compiled with servlet 2.1 :-)
> but I have another ugly question.
> How do I instantiate multiple velocity Runtime?
> I want to setup template file path per indivisual module which run on same
> JVM.

You can't instantiate multiple velocity runtimes, we on allowing
this though. When I'm not sure. Right now there is only one
velocity runtime.

jvz.
 
> PS. sorry for my buggy English. :-)
> Please use easy English in reply for me.
> Thanks. :-)
>