Summary: | Welcome-file not forwarding to servlet | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Seth Ladd <seth> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | mauromol |
Priority: | P3 | ||
Version: | 5.0.18 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | Linux |
Description
Seth Ladd
2004-01-27 01:36:40 UTC
This is like a really ugly use-case, but I have to agree with your reading of the 2.4 servlet-spec in this case. I have to disagree: welcome files cannot possibly apply to extension mapping. This was already discussed with Jean François a while ago. I have one small example to add: if this bug was valid, using the spec mandated default welcome files and servlet mappings, we would always redirect to index.jsp. OK, not sure why welcome files can't apply to extension mappings. More importantly, does the spec say that? If it is implied, it should be explicitly stated. Reading the spec (at least, my interpretation) does not imply that extension mappings and welcome files can't play together. Is this a tomcat limitation or a spec limitation? Thanks! Look at my example. Does that behavior makes sense ? No. So you have your answer :) I have faced the same problem. I have: ... <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> ... <welcome-file-list> <welcome-file>Welcome.do</welcome-file> </welcome-file-list> when I try: http://host:port/ I get 404. if I try http://host:port/Welcome.do works fine. Servlet 2.4 specs says (on pdf version page 76): "If a Web container receives a valid partial request, the Web container must examine the welcome file list defined in the deployment descriptor. The welcome file list is an ordered list of partial URLs with no trailing or leading /. The Web server must append each welcome file in the order specified in the deployment descriptor to the partial request and check whether a static resource or servlet in the WAR is mapped to that request URI." I think its pretty clear that servlet mapping should be applied to welcome-file elements. Also, if I change my dd to: ... <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>/Welcome.do</url-pattern> </servlet-mapping> ... <welcome-file-list> <welcome-file>Welcome.do</welcome-file> </welcome-file-list> Everything works fine (so in this case, Tomcat is performing servlet mapping). It's definitely a bug. Wow, I am so impressed by your arguments (cut & pasted from the comments right above I'm sure) ;) If it wouldn't create a non working container, I would gladly fix this "bug". Thanks for not reopening the report, BTW. Remy Maucherat, I wonder how someone can get so arrogant. Your attitude is just not helping. It's pretty clear that I didn't copy&paste. As you can see, I checked the specs, and also found a work-around (which might be helpful for other people). It would be nice if you could share a little bit of your acknowledge in this matter with us, mere mortals. Of course it would also give credibility to your statements, so other people won't ask again. In short: Why can't it be implemented? Can you answer these two questions ? - how is your example different from the one given on top of the page ? - what do you think will happen, given the default configuration for all webapps is to have index.jsp as (one of) the welcome files, with a default mapping of *.jsp to the JSP processing servlet ? (I did point that out a few comments above, but you don't seem to bother reading; whining is so easy ...) Well, it's interesting to see how this "invalid" bug report and the equivalent bug #37424, classified as "nonsense" by Remy, was actually fixed in Tomcat 7 as bug #47378 ;-) |