Kitching Simon wrote:
Hi Paul,

When you say "the servlet's getInitParameter("test")" what *exactly* do you
mean?

I mean that I called this.getInitParameter("test"), because this is a method inherited from the GenericServlet class.  It is simply a shortcut method for getServletConfig().getInitParameter("test"), according to the documentation.  I don't have an init method for my servlet, I am simply calling up my init parameter from withing doGet.
According to the docs, you should also be able
to do this inside the service method:

Object o = this.getServletConfig().getInitParameter("test");

Yes, this is what I am trying to do.  Maybe I'll try overriding the init() method of my servlet and try to call it up from there, but as you say, the docs say I should be able to do it from within a service method, so I shouldn't have to do this.

Paul

> -----Original Message-----
> From: Paul Hoepfner-Homme [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 26, 2000 4:26 PM
> To:   [EMAIL PROTECTED]
> Subject:      Frustration with getInitParameter
>
> Tomcat 3.2 beta 6.  I have a servlet in the ROOT context.  The web.xml
> file in webapps/ROOT/WEB-INF has this entry:
> <servlet>
>     <servlet-name>...</servlet-name>
>     <servlet-class>MyServlet</servlet-class>
>     <init-param>
>         <param-name>test</param-name>
>         <param-value>here</param-value>
>     </init-param>
>     ...
> </servlet>
>
> From MyServlet I use the servlet's getInitParameter("test") method and it
> returns null.  When I try to iterate through the parameter names, there
> are none to iterate through.
>
> What am I doing wrong??
>
> Thanks
> --
> Paul Hoepfner-Homme
> [EMAIL PROTECTED]
>
> OVEN Digital |  <http://www.oven.com/>
>
--
Paul Hoepfner-Homme
[EMAIL PROTECTED]

OVEN Digital | http://www.oven.com/
 


Reply via email to