velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <>
Subject Re: Injecting properties into Velocity...
Date Wed, 03 Dec 2008 17:48:34 GMT
You can put a ResourceBundle directly into your context:

context.put("labels", ResourceBundle.getBundle("labels"));

and then do


or you can put a java.util.Properties in and just use $props.get('username')

or you can use VelocityTools' ResourceTool class.  For this, you can
either use the VelocityTools infrastructure to put it into the context
or do something like:

context.put("text", new ResourceTool().bundle("labels"));

and then do


On Wed, Dec 3, 2008 at 9:28 AM, carlo latasa <> wrote:
> Hello
> I'm trying to get velocity to use a properties file of mine that has
> customized labels. This is so I can call a velocity tag like : #stextfield(
> "label='member.username.label'" "name='username'" "size=25") where the label
> value would be defined in the properties file.
> Is it just a matter of putting the properties into some kind of static
> Velocity class somewhere?
> Thanks in advance,
> Carlo

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message