velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Setting application-scope properties in velocity servlet
Date Fri, 12 Jul 2002 13:40:52 GMT
On 7/12/02 9:34 AM, "Wojtek Rappak" <> wrote:

> Am I missing something basic?
> Why doesn't this bit of code work?  I've put it at the end of an overriding
> initVelocity() method in my servlet code:
>          Velocity.setProperty( "regforms",regforms );
>          regforms = (RegForms) Velocity.getProperty( "regforms" );
> regforms is an object tree - that shouldn't make a difference. It holds form
> configuration data and I want to have access to it from everywhere.   In
> other words, it's just a simple case of a bit of config data which I want to
> hold in the runtime singleton.

Don't use Velocity's configuration API to hold your data :)

Why can't you just use the servlet API?

There is a 'setApplicationAttribute()' but there is no corresponding 'get'
as this was intended to let you configure properties to send into custom
components (which can read it).

Maybe we add the getAppAtt(), but I still think that using the Velocity API
for this is inappropriate.

Geir Magnusson Jr. 
Research & Development, Adeptra Inc.

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

View raw message