Adding ContextLoaderListener to web.xml in Spring MVC

后端 未结 4 604
执笔经年
执笔经年 2020-12-01 06:39

I am new to Spring MVC. I have a web application. I have the following configuration:



        
4条回答
  •  伪装坚强ぢ
    2020-12-01 07:23

    Only if you have two config xml files. One with Services / DAOs and another with Controller. If you have configured everything in one spring config file you don't need the ContextLoaderListener, just the dispatcher servlet is sufficient.

    It is recommended to split the config into two and use the ContextLoaderListener to create the root application context and the dispatcher servlet to create the web layer application context.

提交回复
热议问题