在整合MyBatis时,将***Mapper.xml文件放在了resources下的mappers文件夹下,可是程序报错说“mappers/*.xml”这个路径不存在(现在也没搞明白为什么)

又将***Mapper.xml文件与***Mapper.java放在一起,如下图所示。

mybatis 整合spring之mapperLocations配置的问题_xml

 

 

然后在Spring.xml(也可能叫做applicationConfig.xml,仅仅名称不同而已)中配置

 

mybatis 整合spring之mapperLocations配置的问题_java_02

 

 

 

 

 这样就不报错了