By default, where does Spring Boot expect views to be stored?

后端 未结 8 2001
盖世英雄少女心
盖世英雄少女心 2020-12-01 06:29

I\'m experimenting on re-writing my configuration-heavy, vanilla Spring MVC project using Spring Boot. I started a brand new Spring Boot project in IntelliJ using the Spring

8条回答
  •  青春惊慌失措
    2020-12-01 07:11

    According to answer given by @Jasbin karki I tried and found placing your html or jsp files in main->webapp->views folder(you should create the webapp & views folders) and adding the following lines in application.properties file does the task. Add the following in application.properties:

    spring.mvc.view.prefix=/views/
    
    spring.mvc.view.suffix=.html //or .jsp- if its a jsp file
    

提交回复
热议问题