spring boot return string instead of .html file

后端 未结 4 2033
无人共我
无人共我 2021-02-15 10:59

I tried to run spring boot application, that will return me the HTML static file on the static folder, the problem was: every time I load the page: 127.0.0.1 I get the String \"

4条回答
  •  花落未央
    2021-02-15 11:38

    When you use annotation @ResponseBody, you actually tell spring to not try to find a view with the returned name. If you want the html, just remove the annotation from the controller method.

提交回复
热议问题