tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Colebatch <>
Subject Re: New to servlets: Parameter initialisation in web.xml
Date Mon, 20 Aug 2001 14:03:46 GMT
you have restarted after editing the web.xml haven't you?  it only gets
parsed at startup... other than that, check you're calling the right
getInitParameter - not the method exists on config and
servlet... depending on where your entry is in the config file, you will
use one or the other.


On Mon, 20 Aug 2001, [iso-8859-1] chris hutchings wrote:

> Hi,
> Thanks for the replies, but perhaps I was a bit vague
> in my description.
> I have written a couple of example servlets which I
> placed in the \webapps\ROOT\WEB-INF\classes folder,
> and these work ok
> The next example that I tried involved setting an
> <init-param> parameter in web.xml (for a counter) and
> a servlet that would use this value.
> (all copied out of a book)
> Since I was using the \webapps\ROOT\WEB-INF\classes
> folder for my servlets, I altered the web.xml in
> The servlet executed ok, but the variable was not
> initialised – I printed it out an it was ‘null’ 
> i.e. the servlets executing from
> \webapps\ROOT\WEB-INF\classes can not see the params
> specified in ROOT/WEB-INF/web.xml.
> hmm, why is this?
> i can now get the supplied examples to work,.
> thanks  chris.
> ____________________________________________________________
> Do You Yahoo!?
> Get your free address at
> or your free address at

View raw message