如何在springboot项目中对html与jsp进行返回

  介绍

今天就跟大家聊聊有关如何在springboot项目中对html与jsp进行返回,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

一、返回html

(1)添加maven依赖

& lt; dependency>   & lt;才能groupId> org.springframework.boot</groupId>   & lt;才能artifactId> spring-boot-starter-thymeleaf</artifactId>   & lt;/dependency>

(2) thymeleaf模板默认寻找资源下,模板文件夹放html页面,静文件夹放css及js

如何在springboot项目中对html与jsp进行返回

(3)引入js,需要使用如下格式

& lt; html  lang=癳n", xmlns: th=癶ttp://www.thymeleaf.org"比;   & lt; script 类型=拔谋?javascript", th: src=https://www.yisu.com/zixun/癅 {/js/jquery/jquery.min.js} ">