Splitting applicationContext to multiple files

前端 未结 5 1809
心在旅途
心在旅途 2020-11-27 11:10

What is the correct way to split Spring\'s configuration to multiple xml files?

At the moment I have

  • /WEB-INF/foo-servlet.xml
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 11:34

    @eljenso : intrafest-servlet.xml webapplication context xml will be used if the application uses SPRING WEB MVC.

    Otherwise the @kosoant configuration is fine.

    Simple example if you dont use SPRING WEB MVC, but want to utitlize SPRING IOC :

    In web.xml:

    
            contextConfigLocation
            classpath:application-context.xml
    
    

    Then, your application-context.xml will contain: these import statements to load various application context files and put into main application-context.xml.

    Thanks and hope this helps.

提交回复
热议问题