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