81,094
社区成员
发帖
与我相关
我的任务
分享
<!-- 采用注释的方式配置bean -->
<context:annotation-config />
<!-- 配置要扫描的包 -->
<context:component-scan base-package="com.action.*"/>
<bean id="sessionTemplate" class="org.mybatis.spring.SqlSessionTemplate" destroy-method="close">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
然后再UsertokenDaoImpl里面使用注入的sessionTemplate
然后@Autowire的usertokenDao就不报错了