velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: feature suggestion
Date Tue, 06 Mar 2001 20:08:57 GMT
David Esposito wrote:
> 
> Ahh ... that one servlet handles the whole init() thing for velocity ...
> Because of this, each additional servlet defined in the web.xml doesn't need
> the <init-param> for the properties file? And velocity won't spaz out,
> crash, or have any other undesireable behavior using this technique?
> 
> It's a shade less elegant than what I proposed, but it seems pretty
> reasonable ... ;)

The point here is that in a webapp, there is only one instance of the
Velocity runtime.  (There can be other webapps, and they will have their
own instance... so you can configure each webapp differently...) 

You can have 10 servlets calling init() 10 times, and it won't make a
difference - the first init() is what sets up Velocity.

So, using the <load-on-startup> technique means that you will have
everything set up before the servlet container starts sending requests
to your servlets.  You don't have to use one of your 'worker' servlets -
you can make one just for this purpose, and keep all of your application
init stuff in there - you are guaranteed that it is invoked before any
other servlet gets a request.

geir



-- 
Geir Magnusson Jr.                               geirm@optonline.com
Developing for the web?  See http://jakarta.apache.org/velocity/

Mime
View raw message