tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: Tomcat 7 Application Context root url mapping broken after reload.
Date Sun, 12 May 2013 19:08:55 GMT
2013/5/12 Zheng Yang <>:
> Hi list,
> I learned that @WebServlet("") is for mapping the application context root.
> e.g. http://localhost:8080/myapp/
> Unfortunately doesn't work after a context reload.
> This problem can be easily reproduced:
> 1.Create a HelloWorld application with a single servlet, say the servlet is
> called
> 2.Map RootServlet to context root using @WebServlet("") annotation
> 3.If you deploy it on a local tomcat server, it will work.
> http://localhost:8080/HelloWorld/ will give whatever you print in
> RootServlet
> 4.But if you reload the app (say using the manager app),
> http://localhost:8080/HelloWorld/ will give 404 error. RootServlet is never
> called this time.
> Environment: Windows 8, Java 7, Tomcat 7.0.40
> Is this the intended behavior or a bug actually?

If it happens as you describe it, then it should be a bug. Please file
an issue in Bugzilla.

Can you attach to your report a simple web application, with source
code, that reproduces the issue?

Two questions:
a) Is it specific to the context root (empty string) mapping?
b) Is it specific to annotations? (Does it work if you specify the
mapping in web.xml)?

BTW, support for such mappings was added to Tomcat 7 rather late (in
7.0.28 - bug 53356 ).  Apparently they are no so widely used.

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message