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

后端 未结 8 2004
盖世英雄少女心
盖世英雄少女心 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:21

    application.properties

    Remove:

    spring.mvc.view.prefix=/view/
    spring.mvc.view.suffix=.jsp
    

    Add:

    spring.thymeleaf.prefix= /WEB-INF/views/
    spring.thymeleaf.suffix= .html
    

    pom.xml

    Remove jasper dependency:

    
        org.apache.tomcat.embed
        tomcat-embed-jasper
        provided
    
    

    Add thymeleaf dependency:

    
        org.springframework.boot
        spring-boot-starter-thymeleaf
    
    

    Details: Using thymeleaf instead of jsp

提交回复
热议问题