为什么:使用SpringBoot集成thymeleaf不能返回页面,只能返回zifuch字符串。

原因:请检查你是不是在controller使用了@RestController注解。

解决方法:1.修改注解为@Controller   2.在方法体中使用ModelAndView。

分析:RestController = Controller + Response ,所以返回的内容为字符串。

学习日记--SpringBoot篇--return页面

学习日记--SpringBoot篇--return页面

相关文章:

  • 2021-05-09
  • 2021-07-08
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-08
  • 2021-10-07
  • 2021-07-08
  • 2021-09-16
  • 2021-09-22
  • 2021-09-03
  • 2022-12-23
相关资源
相似解决方案