@ springboot 踩坑
关于IOC注解
所有类全部交给Spring容器来托管,不要一部分使用new一部分使用注解,这样很容易使某些类注入为空
#关于mybstis配置 自定义xml和自动生成的xml的配置
#配置mybatis的mapper路径,此路径是在target包下的
mybatis:
mapper-locations:
第一个路径为自定义dao的xml,第二个是自动生成的mapper的xml,前面的两条杠不能省啊,捣鼓了一上午
- classpath:dao/.xml
- classpath:com/**/mapper/*.xml