手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

前端怎样快速数据渲染

时间:2024-10-13 13:53:13

1、首先在项目中maven中添加spring-boot-starter-thymeleaf和net.sourceforge.nekohtml

前端怎样快速数据渲染

2、在项目的application.properties配置文件中添加spring.thymeleaf.mode = LEGACYHTML5去掉Thymeleaf对html的强校验

前端怎样快速数据渲染

3、在java文件夹Controller目录创建HelloController类添加请求页面方法,增加hello参数

前端怎样快速数据渲染

4、在resources文件夹templates目录下创建welcome页面中<h1>标签用th:text引进参数hello渲染标签值

前端怎样快速数据渲染
© 手抄报圈