启动SpringBoot项目,输入localhost:8080/index/hi

页面显示为:
Spring Boot Controller访问不了页面
检查代码发现
Controller层代码,用了@RestController注解,它相当于@ResponseBody + @Controller合在一起的作用,返回的就是一个字符串
Spring Boot Controller访问不了页面
解决办法:
将注解换成Controller,即可。

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-05-06
  • 2022-01-08
  • 2021-11-16
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-22
  • 2021-11-08
  • 2021-04-15
  • 2021-11-20
  • 2022-02-06
  • 2021-07-02
相关资源
相似解决方案