0
点赞
收藏
分享

微信扫一扫

SpringBoot 访问html

Gascognya 2023-02-28 阅读 57


1、pom.xml文件配置

<dependency><!--页面模板依赖-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

2、application.properties配置

SpringBoot 访问html_spring

# FreeeMarker 模板引擎配置
spring.thymeleaf.prefix=classpath:/templates/
spring.freemarker.allow-request-override=false
spring.freemarker.cache=false
spring.freemarker.check-template-locatinotallow=true
spring.freemarker.charset=UTF-8
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=false
spring.freemarker.expose-session-attributes=false
spring.freemarker.expose-spring-macro-helpers=false
spring.freemarker.prefix=
# 应该以什么样的路径来访问静态资源,这表示只有静态资源的访问路径为/static/ 时才会处理(如http://localhost:8080/static/css/base.css)
spring.mvc.static-path-pattern: /static/**
#spring.freemarker.request-context-attribute=
#spring.freemarker.settings.*=
#spring.freemarker.suffix=.ftl
#spring.freemarker.template-loader-path=classpath:/templates/ #comma-separated list
#spring.freemarker.view-names= # whitelist of view names that can be resolved

3、

SpringBoot 访问html_css_02

 

举报

相关推荐

0 条评论