Thymeleaf 3 Spring 5 mapping loads String instead HTML

前端 未结 1 1151
清歌不尽
清歌不尽 2021-01-28 18:48

I\'m trying to configure Spring 5 and Thymeleaf 3 together. I\'m working on Eclipse, I build with \'clean install\' and run the app with \'springboot:run\'. I\'ve setup a contro

1条回答
  •  走了就别回头了
    2021-01-28 19:13

    @RestController implicitly puts @ResponseBody on your methods which in your case causes your returned String to be passed directly into the HttpResponse object (instead of being interpreted as a view name).

    So just remove @RestController in MyController class.

    0 讨论(0)
提交回复
热议问题