tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: SnoopServlet - passing params through web.xml
Date Tue, 21 Nov 2000 20:55:02 GMT
Mala Ramakrishnan wrote:

> Hi,
>
> I wanted to learn how to pass init parameters through web.xml, so I
> uncommented the following from
> jakarta-tomcat-3.1/webapps/examples/WEB-INF/web.xml:
> <init-param>
>     <param-name>foo</param-name>
>    <param-value>bar</param-value>
> </init-param>
>
> Yet, when I call SnoopServlet on my browser as follows:
> http://www.blahblah.com:8080/examples/servlet/SnoopServlet
>
> I get empty fields in Servlet init parameters.
>
> I tried the same with rewriting my own SnoopServlet and yet get null in
> this field. Why would that be?
>

Using "/servlet/SnoopServlet" means you are calling the invoker servlet (the one
that is mapped to "/servlet/*"), which then creates a new servlet definition for
a servlet mapped to "/servlet/SnoopServlet".  If you want to reference
initialization parameters, you will need to create your own <servlet>
definition, then create a <servlet-mapping> that maps one or more URLs to it.

>
> Mala

Craig McClanahan



Mime
View raw message