You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "White, Tim" <Ti...@qwest.com> on 2004/01/26 17:04:51 UTC

External velocity.properties for velocity tools?

Hi -

 Is there a way to pass in a JVM param that specifies the location of
velocity.properties?

 Right now, I have a velocity.properties in my WEB-INF dir, but I'd like
to have one in a config dir external to the .war file so that I can
tweak settings in it without having to create a new .war file every
time.  (And so I can have different settings for dev, test, and
production).

 For log4j.properties, I can pass in a -D parameter and override the
log4j.properties that's in my .war file.  I'm hoping I can do the same
with velocity.

 I'm worried that the web.xml setting for the velocity view servlet will
make this difficult.

 Any thoughts?

Thanks,

Tim White

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


Re: External velocity.properties for velocity tools?

Posted by "Manjush G. Menon" <ma...@lycos.co.uk>.
Hi Tim,

So you wanna do things like we do ;)

Are you using  the class.resource.loader for loading the.vm files?

If yes, then the vm files in the config folder will be loaded if its
in the system/Appserver classpath.

Hope this helps

Thanks
--

Manjush G Menon
US TRI

----- Original Message -----
From: "White, Tim" <Ti...@qwest.com>
To: <ve...@jakarta.apache.org>
Sent: Monday, January 26, 2004 9:34 PM
Subject: External velocity.properties for velocity tools?


Hi -

 Is there a way to pass in a JVM param that specifies the location of
velocity.properties?

 Right now, I have a velocity.properties in my WEB-INF dir, but I'd like
to have one in a config dir external to the .war file so that I can
tweak settings in it without having to create a new .war file every
time.  (And so I can have different settings for dev, test, and
production).

 For log4j.properties, I can pass in a -D parameter and override the
log4j.properties that's in my .war file.  I'm hoping I can do the same
with velocity.

 I'm worried that the web.xml setting for the velocity view servlet will
make this difficult.

 Any thoughts?

Thanks,

Tim White

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



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


Re: External velocity.properties for velocity tools?

Posted by Nathan Bubna <na...@esha.com>.
White, Tim said:
>  Is there a way to pass in a JVM param that specifies the location of
> velocity.properties?
>
>  Right now, I have a velocity.properties in my WEB-INF dir, but I'd like
> to have one in a config dir external to the .war file so that I can
> tweak settings in it without having to create a new .war file every
> time.  (And so I can have different settings for dev, test, and
> production).
>
>  For log4j.properties, I can pass in a -D parameter and override the
> log4j.properties that's in my .war file.  I'm hoping I can do the same
> with velocity.
>
>  I'm worried that the web.xml setting for the velocity view servlet will
> make this difficult.

no, there's no way to do this with the VelocityViewServlet out of the box, but
you are free to extend the VVS and override the
loadConfiguration(ServletConfig) method to retrieve the velocity properties
however you like.

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