The servlets named [create_subscription] and [servlet.create] are both mapped to the url-pattern [/create] which is not permitted [duplicate]

原因,代码中在public前已经有了默认的配置路径:

如:

@WebServlet("/ShowUser")
public class ShowUser extends HttpServlet 

如果在xml中继续配置则会出项

The servlets both mapped to the url-pattern 错误

一般理解把其一干掉即可。

如注销xml中的路径,问题解决:

但是注释掉java中的默认路径配置或删除默认路径均无效:

 http://stackoverflow.com/questions/14714706/the-servlets-named-create-subscription-and-servlet-create-are-both-mapped-to

链接是问题解答:

 

 具体可参考下面的推荐链接:

英文:https://blogs.oracle.com/swchan/entry/servlet_3_0_annotations

或中文:

 

http://www.cnblogs.com/xdp-gacl/p/4222902.html

 

posted @ 2016-08-11 17:47  雪飞就飞  阅读(2290)  评论(0编辑  收藏  举报