tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: Frustration with getInitParameter
Date Thu, 26 Oct 2000 14:49:15 GMT
Hi Paul,

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

Do you mean that your servlet's init method is like:

  public void init(ServletConfig config) throws ServletException {
    super.init(config);

  Object o = config.getInitParameter("test");
  ....
 
If so, then all I can say is it works for me.....

According to the docs, you should also be able
to do this inside the service method:

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

I haven't tried this, though..

Regards,

Simon

> -----Original Message-----
> From:	Paul Hoepfner-Homme [SMTP:paulh@oven.com]
> Sent:	Thursday, October 26, 2000 4:26 PM
> To:	tomcat-user@jakarta.apache.org
> 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
> paulh@oven.com
> 
> OVEN Digital |  <http://www.oven.com/>
>  

Mime
View raw message