How to serve static html content page in spring-boot

前端 未结 4 1551
孤独总比滥情好
孤独总比滥情好 2020-12-28 15:17

I\'m starting an embedded tomcat via spring-boot and want to serve a static index.html page as part of a running application.

But the follo

4条回答
  •  情书的邮戳
    2020-12-28 15:25

    For me this worked, i am sure there is a better way ( like without .html ).

    @RequestMapping("/")
    public String index() {
        return "index.html";
    }
    

提交回复
热议问题