velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shahar Solomianik <>
Subject RE: Multiple templates location/VelocityServlet instances
Date Thu, 01 Feb 2001 13:35:53 GMT
Hi geir.

What I ment was that I just dont want my web.xml file full with same init
parameters for all the servlets.
It's not that it doesnt work.


-----Original Message-----
From: []On Behalf Of Geir
Magnusson Jr.
Sent: Thursday, February 01, 2001 2:13 AM
Subject: Re: Multiple templates location/VelocityServlet instances

Shahar Solomianik []

> Them all are in one context.
> so maybe I have to direct this question to tomcat, but :
> Doesnt tomcat have a way to initialize derived servlets ?

That question really doesn't make sense to me.  A servlet is simply an
instance of a class, right? The servlet engine does something on the
order of getInstance() to make one, and uses that for all the requests
mapped to that servlet (generally).

So tomcat simply init's the servlet - the fact that it's derived has no
bearing on the matter.

> Something like Apache JServ's, where I can have
> to supply parameters needed by all servlets in a zone ?
> After all, all my servlets will derive from VelocityServlet.

If you have one properties file, all servlets can use it.  And once one
servlet initializes Velocity, that's all you need - velocity is
initialized and ready, and the rest of the servlets in that webapp
context will use that initialized Velocity runtime. There is no harm in
the other servlets' init() doing the Velocity initialization, as Vel
protects itself.

Does that clear it up a little?  Is there something I am missing?


Geir Magnusson Jr.                     
Velocity : it's not just a good idea. It should be the law.

View raw message