idea中springboot静态资源及页面跳转问题

1,静态资源放在resources/static下,html页面放在resources/templates下

2,在html中引入静态资源时,不用带static(对于路径来说是透明的)

3,

配置html的时候需要使用到其他工具,比如freemarker

spring.freemarker.suffix=.html

spring.freemarker.template-loader-path=classpath:/templates/

pom.xml代码:

 

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>

 

配置jsp页面的时候使用

spring.mvc.view.prefix=/WEB-INF/

spring.mvc.view.suffix=.jsp

 

原文地址:https://www.cnblogs.com/wskb/p/11579811.html