Caused by: java.lang.IllegalArgumentException: The servlets named [ServletDemo] and [day05.ServletDemo] are both mapped to the url-pattern [/ServletDemo] which is not permitted
应该是 /ServletDemo 一个请求映射了 [ServletDemo] and [day05.ServletDemo] 两个servlet
找到原因了
是因为在类定义上面:
@WebServlet("/ServletDemo")//这里
public class ServletDemo extends HttpServlet {
不需要再在web.xml中定义servlet属性了。