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