tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zheng Yang <zhengyan...@gmail.com>
Subject Tomcat 7 Application Context root url mapping broken after reload.
Date Sun, 12 May 2013 12:40:52 GMT
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 RootServlet.java
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?
-- 
------
Regards,
Zheng Yang

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message