You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Wojtek Rappak <ra...@nildram.co.uk> on 2002/05/27 15:06:32 UTC

Servlet session properties

In my VelocityServlet based application, I want to select a template based
on a brand ID passed at the beginning of a session.  There may be hundreds
of templates.

My plan is to put all the template URLs into Velocity.properties - they'll
be keyed by brand ID.  The whole lot would be loaded at init time and I
would use the brand ID to determine the template name returned by my
handleRequest(...).  I would check scope and so this would only happen on
the first request of a session.

This means that my template data will be held in RuntimeSingleton() - it'll
effectively be an application attribute.  I'll get a particular template
name through RuntimeSingleton().getProperty (key).

I'm not entirely happy with this.  This data may soon grow up to several
thousand items (template*content combinations).  I'm effectively mixing it
up with runtime environment data (eg. location of log file) - although
perhaps this IS such data.

Any thoughts on alternative solutions?

Wojtek Rappak



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>