tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Martens" <dlmar...@hotmail.com>
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" <Craig.McClanahan@eng.sun.com>
>Reply-To: tomcat-dev@jakarta.apache.org
>To: tomcat-dev@jakarta.apache.org
>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 
>mentioned
> > 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 
>times.
> > This cannot at all be the correct behaviour at all because this is 
>causing
> > 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 
>this
> > servlet in the conf/web.xml file with the a loadatstartup value of 1 or 
>any
> > 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, 
>four
>init messages is *exactly* what you should see -- one for the instance of 
>this
>servlet loaded in each webapp.  After all, the point of this file is to 
>define
>things that should be loaded for *every* web application.  Try printing out 
>the
>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 
>that
>webapp.
>
>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 
>once.
>
>Craig
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message