java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted

后端 未结 6 2012
深忆病人
深忆病人 2020-11-22 05:21

I tried to add this servlet

package com.classmgt.servlet;

@WebServlet(\"/ControllerServlet\")
public class ControllerServlet extends HttpServlet {}
         


        
6条回答
  •  误落风尘
    2020-11-22 05:40

    The servlets named [Register] and [com.TeamWork.controller.Register] are both mapped to the url-pattern [/Register] which is not permitted

    getting this error you have to remove your servlet mapping from web.xml and just add @WebServlet("/Register") annotation + url

    
         Register
         com.TeamWork.controller
      
    

    then your servlet class on the top add this one

    @WebServlet("/Register")`
    public class Register extends HttpServlet { }
    

    it will work thanks

提交回复
热议问题