1-错误信息:type = internal Server Error
idea控制台
org.apache.ibatis.binding.BindingException:
Invalid bound statement (not found): com.bjpowernode.springboot.mapper.StudentMapper.selectByPrimaryKey
浏览器页面报错:state 500
解决办法:
- 默认情况下,Mybatis的xml映射文件不会编译到target的class目录下,所以我们需要在pom.xml文件中配置resource
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
2-错误信息:type=Not Found, status=404
后端 debug 发现Controller可以从后台得到数据,后来发现是 controller 中的方法未注解 @ResponseBody
浏览器页面: