Spring Boot Controller访问不了页面

启动SpringBoot项目,输入localhost:8080/index/hi 页面显示为: 检查代码发现 Controller层代码,用了@RestController注解,它相当于@ResponseBody + @Controller合在一起的作用,返回的就是一个字符串 解决办法: 将注解换成Controller,即可。
相关文章
相关标签/搜索