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