spring web, security + web.xml + mvc dispatcher + Bean is created twice

后端 未结 3 474

I have the Web.xml as below:

 
    mvc-dispatcher
    org.springframework.web.se         


        
3条回答
  •  鱼传尺愫
    2020-11-30 05:44

    http://docs.spring.io/spring/docs/3.0.0.M3/reference/html/ch16s02.html

    The framework will, on initialization of a DispatcherServlet, look for a file named [servlet-name]-servlet.xml in the WEB-INF directory of your web application and create the beans defined there (overriding the definitions of any beans defined with the same name in the global scope).

    So you can remove the context-param:

    
        contextConfigLocation
        
            /WEB-INF/mvc-dispatcher-servlet.xml
        
    
    

提交回复
热议问题