tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Rudnicki <jdr5l...@pacbell.net>
Subject Bug in getInitParameter() ?
Date Sat, 27 May 2000 08:59:56 GMT
I've just bashed up against odd behavior of  getInitParameter().  It seems
that the canonical name specified in the web.xml must exactly match the
class name or it does not work. e.g. access
/myapp/servlet/abc.vault.PostFile

<servlet>
  <servlet-name>pfa</servlet-name>
  <servlet-class>abc.vault.PostFile</servlet-class>

does not result in getInitParameter() returning values.  Oddly add a
mapping:

<servlet-mapping>
   <servlet-name>pfa</servlet-name>
   <url-pattern>/pfile</url-pattern>

and the same servlet does get the init parameters only when accessed thru
the mapped url: /myapp/pfile

If I change the canonical to match the fully qualified class name:

<servlet>
  <servlet-name>abc.vault.PostFile</servlet-name>
  <servlet-class>abc.vault.PostFile</servlet-class>

then /myapp/servlet/abc.vault.PostFile does get the init parameters, and the
mapped url also does.

Odd?

Jim







Mime
View raw message