在Spring的applicationContext.xml中配置映射文件的方法:
<propertyname="mappingResources">
</property>
当配置文件变得越来越多,修改起来也越来越烦人,而且基于XML的配置也可能带来输入的错误,导致你可能因为一个字符的错误而找上半天。
现在,你只要指出文件夹就可以了,Spring会替你找出所有映射文件
<propertyname="mappingDirectoryLocation s">
</property>
也可以通过classpath来指出
<propertyname="mappingDirectoryLocation s">
</property>