.一般问题出在:
1.controller层没有加@ResponseBody
2.Service层实现类未添加注解@Autowired
3.@RestController使用成了@Controller
4. Controllor层调用的方法是private私有的,导致分发失败。
5. 编译出错重新编译一下项目 IDEA导航栏 --> Build --> ReBuild Project
我检查了半天,都没有问题,我发现还出现了如下的错误提示:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.shuang.dao.informationInput.cont.Cont_infor_dao.findAll] with root cause
问题是:mybatis中mapper xml的扫描出错了。
*.xml是扫描当前包下的所有xml文件。
/**/*.xml扫描当前包及其子包下的所有xml文件