原因,代碼中在public前已經有了默認的配置路徑:
如:
@WebServlet("/ShowUser")
public class ShowUser extends HttpServlet
如果在xml中繼續配置則會出項
The servlets both mapped to the url-pattern 錯誤
一般理解把其一干掉即可。
如注銷xml中的路徑,問題解決:
但是注釋掉java中的默認路徑配置或刪除默認路徑均無效:
鏈接是問題解答:
具體可參考下面的推薦鏈接:
英文:https://blogs.oracle.com/swchan/entry/servlet_3_0_annotations
或中文:
http://www.cnblogs.com/xdp-gacl/p/4222902.html