You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2001/02/01 01:12:30 UTC

Re: Multiple templates location/VelocityServlet instances

Shahar Solomianik [mailto:shahar@tikalknowledge.com] 

> 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 zone.properties, where I can have servlet.default.initArgs=...
> 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


-- 
Geir Magnusson Jr.                               geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity