cmd + ;
換一個spring專案
第二個需要手動選擇新增非特殊的檔案
@Autowired
<!-- mapper scanner configurer --> <bean id="mapperScannerConfig" class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.adu.spring_test.mybatis.dao" /> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" /> </bean> 複製程式碼
解決方案:
個人覺得:降低Autowired檢測的級別較好,因為關聯Spring確實可以帶來編碼的便利,而且自動引入錯誤較少出現,也很容易發現改正。