how to reference a bean of another xml file in spring

前端 未结 6 1353
花落未央
花落未央 2020-12-07 17:30

I have a Spring bean defined in an xml file. I want to reference it from another xml file. How can I go about it?

6条回答
  •  温柔的废话
    2020-12-07 18:32

    Answer provided by tolitius is very detailed. Just for the problem mentioned by Peter Butkovic

    for me web.xml chunk throws error. One param-value seems to be allowed only in place. – Peter Butkovic

    I met the same problem and solved by spliting two paths with "," in the same tag.

    It will look like this

        
            contextConfigLocation
            /WEB-INF/applicationContext.xml,
                         /WEB-INF/daoContext.xml
            
        
    

提交回复
热议问题