Changing default welcome-page for spring-boot application deployed as a war

前端 未结 4 1985
梦谈多话
梦谈多话 2020-12-01 08:21

I was trying to find a way to change the default welcome-page for a spring-boot application that is being deployed as a war in production but I can\'t find a way to do it wi

4条回答
  •  盖世英雄少女心
    2020-12-01 08:44

    Following Michael's tutorial, I was able to just map / to my index.gsp file.

    @Controller
    class Routes {
    
        @RequestMapping({
            "/",
            "/bikes",
            "/milages",
            "/gallery",
            "/tracks",
            "/tracks/{id:\\w+}",
            "/location",
            "/about"
        })
        public String index() {
            return "forward:/index.gsp";
        }
    }
    

提交回复
热议问题