Re: Problem with overriding the default servlet on tc 6.0.18
2009/6/9 Bill Barker wbar...@wilshire.com: Incidentally I discovered you can't welcome-file-list by having an empty element, you have to have at least one welcome-file in there or the default servlet will use the one in $CATALINA_BASE/conf/web.xml . Bug or feature? I'd say an enhancement rather than a bug, since you can always do (as you have discovered): welcome-file-list welcome-fileindex.doesnotexist/welcome-file /welcome-file-list For the benifit of the archives, this of course assumes that you have set replaceWelcomeFiles=true in the Context ... / element. The above said about replaceWelcomeFiles is wrong. That property is not documented and is used by Tomcat internals only. It is automatically switched on before processing a web.xml file, and thus its initial value, as specified in context file, does not matter. The welcome files list in a web application always replaces the default one. In web-app_2_3.dtd there is !ELEMENT welcome-file-list (welcome-file+) so the list cannot be empty. In 2.4 and 2.5 schemas the minOccurs attribute for welcome-file element is 1 (the default value), so the list cannot be empty either. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with overriding the default servlet on tc 6.0.18
--- Original Message --- From: Joseph S j...@selectacast.net To: Tomcat Users List users@tomcat.apache.org Sent: 09/06/09, 01:58:45 Subject: Re: Problem with overriding the default servlet on tc 6.0.18 Joseph S wrote: After restarting tomcat it started working by itself, but only if I've overriden the default welcome-file-list in my web.xml try mapping your servlet to /* rather than / Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with overriding the default servlet on tc 6.0.18
Mark Thomas wrote: --- Original Message --- From: Joseph S j...@selectacast.net To: Tomcat Users List users@tomcat.apache.org Sent: 09/06/09, 01:58:45 Subject: Re: Problem with overriding the default servlet on tc 6.0.18 Joseph S wrote: After restarting tomcat it started working by itself, but only if I've overriden the default welcome-file-list in my web.xml try mapping your servlet to /* rather than / That's worse actually. Then my jsps were being handled by my servlet instead of jasper - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with overriding the default servlet on tc 6.0.18
Joseph S wrote: Mark Thomas wrote: --- Original Message --- From: Joseph S j...@selectacast.net To: Tomcat Users List users@tomcat.apache.org Sent: 09/06/09, 01:58:45 Subject: Re: Problem with overriding the default servlet on tc 6.0.18 Joseph S wrote: After restarting tomcat it started working by itself, but only if I've overriden the default welcome-file-list in my web.xml try mapping your servlet to /* rather than / That's worse actually. Then my jsps were being handled by my servlet instead of jasper Sorry - didn't realise you had other servlets in play. Mentioned it as a way of over-ridding the welcome file list. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problem with overriding the default servlet on tc 6.0.18
I have this in the web.xml of my application: servlet-mapping servlet-name MyServlet /servlet-name url-pattern / /url-pattern /servlet-mapping Which works fine, except for requests without pathinfo (i.e. http://servername/ ). That still seems to be handled by the default tomcat servlet, which is serving up the index.jsp that I no longer want to use. Am I doing something wrong or is this a bug? Incidentally I discovered you can't welcome-file-list by having an empty element, you have to have at least one welcome-file in there or the default servlet will use the one in $CATALINA_BASE/conf/web.xml . Bug or feature? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with overriding the default servlet on tc 6.0.18
After restarting tomcat it started working by itself, but only if I've overriden the default welcome-file-list in my web.xml or move index.jsp out of the way, implying that the default tomcat servlet is running *before* mine and then handing off to mine. I checked and requesting a plain static file does get handled by my servlet instead of the tomcat default, so this is only an issue with / Joseph S wrote: I have this in the web.xml of my application: servlet-mapping servlet-name MyServlet /servlet-name url-pattern / /url-pattern /servlet-mapping Which works fine, except for requests without pathinfo (i.e. http://servername/ ). That still seems to be handled by the default tomcat servlet, which is serving up the index.jsp that I no longer want to use. Am I doing something wrong or is this a bug? Incidentally I discovered you can't welcome-file-list by having an empty element, you have to have at least one welcome-file in there or the default servlet will use the one in $CATALINA_BASE/conf/web.xml . Bug or feature? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with overriding the default servlet on tc 6.0.18
Joseph S wrote: After restarting tomcat it started working by itself, but only if I've overriden the default welcome-file-list in my web.xml More on this: I discovered that reloading the webapp itself doesn't work, I have to restart Tomcat itself in order to get the welcome file list override to take. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with overriding the default servlet on tc 6.0.18
Joseph S j...@selectacast.net wrote in message news:4a2da6d6.50...@selectacast.net... I have this in the web.xml of my application: servlet-mapping servlet-name MyServlet /servlet-name url-pattern / /url-pattern /servlet-mapping Which works fine, except for requests without pathinfo (i.e. http://servername/ ). That still seems to be handled by the default tomcat servlet, which is serving up the index.jsp that I no longer want to use. Am I doing something wrong or is this a bug? This is a feature. Tomcat needs to process the welcome-file-list before doing Servlet mapping so that the correct servlet is invoked for the welcome file. Incidentally I discovered you can't welcome-file-list by having an empty element, you have to have at least one welcome-file in there or the default servlet will use the one in $CATALINA_BASE/conf/web.xml . Bug or feature? I'd say an enhancement rather than a bug, since you can always do (as you have discovered): welcome-file-list welcome-fileindex.doesnotexist/welcome-file /welcome-file-list For the benifit of the archives, this of course assumes that you have set replaceWelcomeFiles=true in the Context ... / element. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org