I was wondering about that.
I just finished reading the Servlet Specification and they made no
mention of Init Params under the servlet element. And I wondered how
they interacted with Init Params at the context level.
You're saying that the servlet init params completely over shadow the
context init params?
fern
On Sun, 28 Jan 2001, William Brogden wrote:
>
>
> Matt Campbell wrote:
> >
> > Hi All,
> >
> > this is an addition to my last post, a bit more info in case its any use. I've
> > just tried to run
> > TOMCAT_HOME/webapps/examples/WEB-INF/classes/SnoopServlet.class after
> > un-commenting its init-params in TOMCAT_HOME/webapps/examples/WEB-INF/web.xml
> > The servlet runs fine, except that it doesnt find its init-params. I have made
> > no changes except for un-commenting those params. Why wont it find them??
> >
> > Cheers
> >
> > Matt
> >
>
> Ah yes - this annoying little quirk.
>
> If you address SnoopServlet.class directly as above, Tomcat does NOT
> associate
> it with the entry in web.xml therefore you don't get init params. If you
> address
> it as snoop - the alias that the web.xml sets up with:
>
> <servlet>
> <servlet-name>
> snoop
> </servlet-name>
> <servlet-class>
> SnoopServlet
> </servlet-class>
> <init-param>
> <param-name>foo</param-name>
> <param-value>bar</param-value>
> </init-param>
> </servlet>
>
> then you will get the init params!!!!
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]