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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM