简体   繁体   中英

<import/> statements in Spring MVC

If I have a statement in my servlet.xml like this:

<import resource="classes/com/au/curtin/example.xml/>

and an example.xml at that directory location that has Spring bean definitions as well as things like <component:context-scan/> and <tx:annotation-driven/> . Are these statements imported along with the bean definitions into the servlet.xml context or do I need to include duplicate <component:context-scan/> in my servlet.xml file?

The main purpose of import is to avoid duplication. With import the file is completely imported.Everything including bean defination and other configurations are copied.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM