您的位置:首页 > 编程语言 > Java开发

Caused by: java.lang.IllegalArgumentException: The servlets the url-pattern which is not permitted

2016-08-26 00:00 861 查看
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属性了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐