velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Esposito" <espos...@newnetco.com>
Subject RE: feature suggestion
Date Tue, 06 Mar 2001 18:27:50 GMT
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 ... ;)

> -----Original Message-----
> From: gmj@mta4.srv.hcvlny.cv.net [mailto:gmj@mta4.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> Sent: Tuesday, March 06, 2001 1:27 PM
> To: velocity-user@jakarta.apache.org
> Subject: Re: feature suggestion
>
>
> David Esposito wrote:
> >
> > Can you have the init() method default to a "properties" init
> param in the
> > context if one is not defined in the servlet tag? That is, what
> I've done
> > for most of my application is put all of my parameters in the
> context ...
>
>
> [SNIP]
>
> I am probably not answering your question, but I think I know what you
> want, and there is a conventional way to do it that doesn't require any
> code change.
>
> You don't need it in every servlet in the descriptor. Just do it in one,
> and put in
>
>   <load-on-startup>1</load-on-startup>
>
> and the that servlet will be instantiated and have it's init(
> ServletConfig ) method called. Since you only need one call to
> Runtime.init() to configure Vel, this works just fine.
>
> I use this myself in production, cuz the whole <param> thing got boring
> :)
>
> ex :
> <servlet>
>     <servlet-name>ContentCtrl</servlet-name>
>     <servlet-class>com.ridersonline.servlet.ContentCtrl</servlet-class>
>     <init-param>
>       <param-name>properties</param-name>
>       <param-value>velocity.properties</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>
>
> Does that solve it?
>
> geir
>
>
>
>
> --
> Geir Magnusson Jr.                               geirm@optonline.com
> Developing for the web?  See http://jakarta.apache.org/velocity/


Mime
View raw message