Spring boot初探----建立第一个属于自己的HTML5页面

前言:

  1. 可以参考项目结构
  2. 在application.properties中配置h5页面的路径

一、直接上项目结构与代码框架:

二、application.properties的配置

​​#thymelea模板配置
#在构建URL时添加到视图名称前的前缀(默认值:classpath:/templates/)
spring.freemarker.template-loader-path=classpath:/templates/
#在构建URL时添加到视图名称后的后缀(默认值:.html)
spring.freemarker.suffix=.html
#要运用于模板之上的模板模式。另见StandardTemplate-ModeHandlers(默认值:HTML5)
spring.thymeleaf.mode=HTML5
#模板编码
spring.thymeleaf.encoding=UTF-8
##开启模板缓存(默认值:true)
spring.thymeleaf.cache=false
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**
#容器启动时加载优先级。当值小于0或者没有指定时,则表示容器在该servlet被选择时才会去加载;正数的值越小,该servlet的优先级越高,应用启动时就越先加载。
spring.mvc.servlet.load-on-startup=10

三、pom.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<packaging>jar</packaging>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.3.0.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值