启动程序时报的错,The servlets .. are both mapped to the url-pattern [/IndexServlet] which is not permitted

这已经是第二次犯错了,所以需要记录下来。

启动程序时报的错,The servlets .. are both mapped to the url-pattern [/IndexServlet] which is not permitted

原因是由于:

新版本的eclipse不会去自己生成web.xml,也不需要自己去配置xml文件。

eclipse已经有另外一种好的解决方案:利用@WebServlet annotation

所以你重复配置了这个。

解决方案是删除web.xml文件。或者删除@webServlet