You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/07/11 12:52:26 UTC

DO NOT REPLY [Bug 49582] New: Mapping a servlet to the root (/) doesn't work when accessing the root

https://issues.apache.org/bugzilla/show_bug.cgi?id=49582

           Summary: Mapping a servlet to the root (/) doesn't work when
                    accessing the root
           Product: Tomcat 7
           Version: 7.0.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: glamd@abv.bg


I'm developing a spring mvc app, with the dispatcher servlet mapped:

<servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
</servlet-mapping>

Until today I ran it on Tomcat 6.0.18 and it worked fine. Then I deployed the
web-app to Tomcat 7.0.0 Beta, and the result is:

- when I access the "http://localhost:8080/mycontext/" I get 404: The requested
resource (/mycontext/) is not available.
- when I access other locations "http://localhost:8080/mycontext/something" it
works fine

I tried to reproduce it with a simple servlet, annotated with
@WebServlet(urlMappings="/") and the result is the same - when opening the root
of the context the servlet is not triggered. When any other URI is accessed,
the servlet works fine.

Then I commented out the default servlet mapping of CATALINA_HOME/conf/web.xml,
but it still doesn't work.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49582] Mapping a servlet to the root (/) doesn't work when accessing the root

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49582

--- Comment #2 from bozho <gl...@abv.bg> 2010-07-12 11:45:21 EDT ---
I can't override the <welcome-file-list /> - I have to delete it from
conf/web.xml, which is not good

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49582] Mapping a servlet to the root (/) doesn't work when accessing the root

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49582

--- Comment #3 from Mark Thomas <ma...@apache.org> 2010-07-12 11:59:54 EDT ---
Specifying and empty list *should* override the one in the default web.xml. If
that isn't the case, that is a bug that needs fixing. If so, please open a
separate bug for that and it should get fixed for 7.0.1.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49582] Mapping a servlet to the root (/) doesn't work when accessing the root

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49582

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Mark Thomas <ma...@apache.org> 2010-07-11 17:13:40 EDT ---
What I suspect is happening is that you have a set of welcome files that
include index.jsp. The requirements of section 10.10 of the Servlet 3.0 spec
mean that the request matches the JSP servlet so the request gets mapped to the
JSP servlet which then results in a 404 since index.jsp does not exist.

You have two options:
- remove index.jsp from the list of welcome files
- map the dispatcher servlet to /* which will bypass the welcome files

The 2.5 spec wasn't as clear as the 3.0 spec on this point. Tomcat 7 implements
the requirements for welcome files without a physical backing.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 49582] Mapping a servlet to the root (/) doesn't work when accessing the root

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49582

--- Comment #4 from bozho <gl...@abv.bg> 2010-07-12 13:36:41 EDT ---
Sorry, my mistake. I tried <welcome-file-list />, which is invalid according to
the schema. So
<welcome-file-list><welcome-file></welcome-file></welcome-file-list> did it,
instead.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org