Bug 54955 - Mapping to application context root returns 404 after reload
Mapping to application context root returns 404 after reload
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.40
PC All
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-05-13 03:50 UTC by Zheng Yang
Modified: 2013-05-21 03:55 UTC (History)
1 user (show)



Attachments
A minimum war file to reproduce the bug with sources attached (2.17 KB, application/octet-stream)
2013-05-13 03:50 UTC, Zheng Yang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zheng Yang 2013-05-13 03:50:12 UTC
Created attachment 30273 [details]
A minimum war file to reproduce the bug with sources attached

URL mapping specified as ""(empty string) maps a servlet to the context root according to servlet specification. This feature is working when an application is deployed, but broken when it's reloaded. A reload will result in 404 error. (Other url mappings are OK, only "")

Steps to reproduce:

1) Create a servlet with URL mapping as empty string, you can either use @WebServlet("") annotation or <url-pattern></url-pattern> in web.xml

2) If you deploy it in Tomcat 7.0.40, it will work. (e.g. http://localhost:8080/myapp/) 

3) But if you reload the app (say using the manager app), http://localhost:8080/myapp/ will give 404 error. Servlet in step 1 is never called this time.

Actual Results: 404 Not Found

Expected Results: Show the context root page.

Env: Tomcat 7.0.40, Java 7, Windows 8
Comment 1 Violeta Georgieva 2013-05-21 03:55:09 UTC
Thanks for the report.
Fixed in trunk and 7.0.x and will be included in 7.0.41 onwards.