spring 配置文件 非常容易错误的写法, 谨记(注解不可写在块里面)

错误实例
<!--配置mybatis工厂-->

<bean class="org.mybatis.spring.SqlSessionFactoryBean" id="factoryBean">
<property name="dataSource " ref="dataSource"/>
<!--引入mybatis核心配置文件-->
<property name="configLocation" value="classpath:mybatis-config.xml"/>
</bean>


<!--配置mybatis工厂-->
<bean id="sqlSessionFactory"  class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis-config.xml"/>
</bean>
posted @ 2022-04-28 14:26  黄河远15  阅读(27)  评论(0编辑  收藏  举报