tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Martens" <>
Subject Re: Bug found when calling init methods of defined web apps
Date Fri, 28 Jul 2000 10:23:56 GMT
Ahh...I see what you mean.  I have just tested it, and it works fine.  All 
that debugging for nothing....sorry about that and thanks for your help.

>From: "Craig R. McClanahan" <>
>Subject: Re: Bug found when calling init methods of defined web apps
>Date: Thu, 27 Jul 2000 15:43:35 -0700
>Dan Martens wrote:
> > If you had read the rest of my post you would have noticed that I 
> > that each entry in the conf/web.xml file is being loaded four different
> > times.  So essentially the same file is being parsed four different 
> > This cannot at all be the correct behaviour at all because this is 
> > four different instances of every single defined webapp in the file, all
> > with the same mapping. If still do not know what I mean, create a simple
> > testing servlet with a println statement in the init method.  Define 
> > servlet in the conf/web.xml file with the a loadatstartup value of 1 or 
> > other +ve integer.  Then run tomcat, and watch the standard out.  This
> > should clarify my point.
> >
>If you define your servlet in "conf/web.xml", and there are four webapps, 
>init messages is *exactly* what you should see -- one for the instance of 
>servlet loaded in each webapp.  After all, the point of this file is to 
>things that should be loaded for *every* web application.  Try printing out 
>value of
>     getServletContext().getRealPath("/")
>in the println() message, and you will see what I mean.  The real path of 
>for each webapp will be the pathname to the document root directory for 
>If you define your sevlet in the "WEB-INF/web.xml" file for your own web
>application (which is what you should be doing for portability -- reading
>"conf/web.xml" is a Tomcat-specific feature), it will be initialized just 
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Get Your Private, Free E-mail from MSN Hotmail at

View raw message