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