On 26/02/2011 19:16, Konstantin Kolinko wrote: > Hi! > > I was reviewing Mark's comment in > https://issues.apache.org/bugzilla/show_bug.cgi?id=33405#c1 > > 1) >> A mal-formed web.xml is ignored > > It is ignored in TC7, but it causes the app startup to fail in TC5.5 and TC6. > > I think in TC7 the app startup should fail as well, > because there might be security constraints there which won't be > enforced if we ignore the file. > > To reproduce: > 1. start TC7 > 2. edit webapps/examples/WEB-INF/web.xml s/web-app/we b-app/ > 3. parsing errors are logged, but the app is still available for requests > > Do we agree that it is a bug?
Drat. I was looking at this solely in terms of bug 33405. Of course, you are right. The webapp should not start in this case. I'll fix that. It might well make bug 33405 a WONTFIX. > A patch might look like the following: > [[[ > Index: java/org/apache/catalina/startup/ContextConfig.java > =================================================================== > --- java/org/apache/catalina/startup/ContextConfig.java (revision > 1074853) > +++ java/org/apache/catalina/startup/ContextConfig.java (working copy) > @@ -1222,8 +1222,12 @@ > orderedFragments = WebXml.orderWebFragments(webXml, > fragments); > > // Step 3. Look for ServletContainerInitializer > implementations > - ok = processServletContainerInitializers(orderedFragments); > - > + if (ok) { > + if > (!processServletContainerInitializers(orderedFragments)) { > + ok = false; > + } > + } > + > // Step 4. Process /WEB-INF/classes for annotations > // This will add any matching classes to the > typeInitializerMap > if (ok) { > @@ -1274,7 +1278,6 @@ > } > } else { > webXml.configureContext(context); > - ok = true; > } I agree with the affect this patch has but reviewing the code, I think the ok flag needs to used consistently. The processServletContainerInitializers() method is an anomaly at the moment. I have patch that I'll apply shortly. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org