springboot整合 thymeleaf
阿新 • • 發佈:2018-12-19
pom
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
application.yml
spring: thymeleaf: prefix: classpath:/templates/ check-template-location: true suffix: .html encoding: UTF-8 content-type: text/html mode: HTML5 cache: false
StringbootApplication 類
public class StringbootApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(StringbootApplication.class); } public static void main(String[] args) { SpringApplication.run(StringbootApplication.class, args); } }