Well, I tried to declare the per-host web.xml as a web-fragment like this but it does not work:
<web-fragment> <ordering> <before> <others /> </before> </ordering> ... </web-frament> Tomcat is expecting a <web-app> which can only contain <absolute-ordering> which must reference other fragments. I wanted the content of the host web.xml to be applied first and transparently to the webapp. Xavier ---------------------------------------- > From: kal...@hotmail.com > To: users@tomcat.apache.org > Subject: RE: Default web.xml for all webapps of a specific Host > Date: Thu, 16 May 2013 16:55:55 +0200 > > Ok, I checked with only listeners and filter-mappings (whose order matters) > and the resulting order is the following (from top to bottom in effective > web.xml): > > 1: main web.xml > 2: global web.xml > 3: host web.xml.default > > So is it possible to have them in order (2, 3, 1)... I guess not but there's > no harm in asking =) > > Thanks, > > Xavier > > ---------------------------------------- >> Date: Thu, 16 May 2013 15:01:28 +0100 >> From: ma...@apache.org >> To: users@tomcat.apache.org >> Subject: Re: Default web.xml for all webapps of a specific Host >> >> On 16/05/2013 14:47, Xavier Dury wrote: >>> I tried adding a >>> $CATALINA_BASE/conf/[enginename]/[hostname]/web.xml.default and checked >>> what was the resulting web.xml with logEffectiveWebXml="true". I noticed >>> that the order of the various elements (filter, servlets...) appeared as: >>> >>> 1. conf/web.xml >>> 2. WEB-INF/web.xml >>> 3. $CATALINA_BASE/conf/[enginename]/[hostname]/web.xml.default >>> >>> I would have expected WEB-INF/web.xml to be the last one (or the first one >>> if you want, but certainly not between the 2 others). Is it normal? >> >> The expected processing order is: >> >> 1. Create a blank representation of web.xml >> 2. Parse global web.xml into 1 >> 3. Parse host web.xml into 1. This process is additive except for >> welcome files which will use replacement >> 4. Process main web.xml including fragments >> 5. Merge the defaults from 3 into 4 as if they were a fragment >> >> Note that order in the resulting web.xml only applies to elements where >> order is important (e.g. listeners). Servlets and Filters will be >> displayed in whatever order they come out of the associated HashMaps. >> >> Mark >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org