Why Spring Context is loaded twice?

后端 未结 5 1144
终归单人心
终归单人心 2021-01-05 12:20

I have web project with Spring and Spring security. My web.xml:

    

        
5条回答
  •  [愿得一人]
    2021-01-05 12:44

    Since you have spring delegatingFilterProxy, if you drop contextLoaderLister you will get the below exception.

    java.lang.IllegalStateException: No WebApplicationContext found: 
    no   ContextLoaderListener registered?
    

    So load security-config.xml via contextLoaderLister and billboard-servlet.xml via dispatcher servlet.

提交回复
热议问题