spring boot return string instead of .html file

后端 未结 4 2025
无人共我
无人共我 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:30

    By Default Spring Boot Looks For your html templates in templates folder static folder is for your other files like css and js .Try moving your html files in src/main/resources/templates folder and remove @ResponseBody from your controller method and remove this from your application properties spring.mvc.view.prefix=/static. I hope it will work.

提交回复
热议问题