Thymeleaf模板引擎与springboot关联后,在html中无法使用el表达式获取model存的值
头部引入了thymeleaf
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
在html中使用
<div><input value="${abilityName}"/></div>
页面展示

经排查,使用方法不对
因为每个模板有自己的取值语法,thymeleaf用的是下面这种
<div><input th:value="${abilityName}"/></div>
在js中调用方式,已一个ajax请求参数为例
$.ajax({
url:'/ability/listChartData',
type:'post',
async : true,
dataType:"json",
data:{
'abilityName':`[[${abilityName}]]`,
'calType':`[[${calType}]]`
},
success:function(data){
myChart.hideLoading();
// 使用刚指定的配置项和数据显示图表。
myChart.setOption({
legend: {
data: data.legendData,//data.legendData,
selected: data.selected
},
series: [{
data: data.seriesData,
}]
});
},
error:function(){
myChart.hideLoading();
}
Thymeleaf模板引擎与springboot关联后,在html中无法使用el表达式获取model存的值的更多相关文章
- Thymeleaf模板引擎的初步使用
在springboot中,推荐使用的模板引擎是Thymeleaf模板引擎,它提供了完美的Spring MVC的支持.下面就简单的介绍一下Thymeleaf模板引擎的使用. 在controller层中, ...
- SpringBoot使用thymeleaf模板引擎
(1).添加pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactI ...
- (二)SpringBoot基础篇- 静态资源的访问及Thymeleaf模板引擎的使用
一.描述 在应用系统开发的过程中,不可避免的需要使用静态资源(浏览器看的懂,他可以有变量,例:HTML页面,css样式文件,文本,属性文件,图片等): 并且SpringBoot内置了Thymeleaf ...
- 【Springboot】Springboot整合Thymeleaf模板引擎
Thymeleaf Thymeleaf是跟Velocity.FreeMarker类似的模板引擎,它可以完全替代JSP,相较与其他的模板引擎,它主要有以下几个特点: 1. Thymeleaf在有网络和无 ...
- SpringBoot入门篇--使用Thymeleaf模板引擎进行页面的渲染
在做WEB开发的时候,我们不可避免的就是在前端页面之间进行跳转,中间进行数据的查询等等操作.我们在使用SpringBoot之前包括我在内其实大部分都是用的是JSP页面,可以说使用的已经很熟悉.但是我们 ...
- SpringBoot:2.SpringBoot整合Thymeleaf模板引擎渲染web视图
在Web开发过程中,Spring Boot可以通过@RestController来返回json数据,那如何渲染Web页面?Spring Boot提供了多种默认渲染html的模板引擎,主要有以下几种: ...
- 九、SpringBoot集成Thymeleaf模板引擎
Thymeleaf咋读!??? 呵呵,是不是一脸懵逼...哥用我的大学四级英文知识告诉你吧:[θaimlif]. 啥玩意?不会音标?...那你就这样叫它吧:“赛母李府”,大部分中国人是听不出破绽的.. ...
- SpringBoot--- Shiro(拦截,认证)、Thymeleaf(模板引擎)
SpringBoot--- Shiro(拦截,认证).Thymeleaf(模板引擎) 环境 IDEA :2020.1 SpringBoot: 2.3.3 Java : 8 版本依赖: shiro- ...
- 三、thymeleaf模板引擎构建前台html, 后台使用 ModelAndView 和 Model 模型
项目源码:https://github.com/y369q369/springBoot.git -> thymeleaf 私聊QQ: 1486866853 1.pom.xml中 ...
随机推荐
- R scholar和rentrez | NCBI和Google scholar文献数据挖掘
主要会用到两个R包: rentrez: 'Entrez' in Rscholar: Analyse Citation Data from Google Scholar RISmed 包可以查询 Pub ...
- ConsoleWebsocketServer服务端和ConsoleWebsocketClient客户端
本文是简述了Websocket的服务端和客户端的实时通讯过程,Websocket的服务端和客户端的具体使用使用了2种Websocket的服务端和2种客户端. 以下代码使用的是Visual Studio ...
- SonarQube Detection of Injection Flaws in Java, C#, PHP
Code Quality Tools Review: Sonar, PMD, Findbugs and Checkstyle Sonar CheckStyle, FindBugs and PMD - ...
- 产品经理 写SQL
产品经理必备技能:写SQL - 云+社区 - 腾讯云https://cloud.tencent.com/developer/news/3177 产品经理学SQL(一)一个小时上手SQL | 人人都是产 ...
- docker 安装redis 并配置外网可以访问
1, docker 拉去最新版本的redis docker pull redis #后面可以带上tag号, 默认拉取最新版本 2, docker安装redis container 安装之前去定义我们的 ...
- 完美解决Cannot download "https://github.com/sass/node-sass/releases/download/binding.nod的问题
①:例如很多人第一步就会这样做: 出现:Cannot download "https://github.com/sass/node-sass/releases/download/版本号/XX ...
- 001——Angular环境搭建、运行项目、搭建项目
1.安装node.js 和cnpm 2.cnpm install -g @angular/cli 安装angular脚手架: 3.ng new angulardemo cd angulardemo ...
- linux追加所有文件到新的文件(cat)
例子如下,存在test1.txt, test2.txt, test3.txt,现在准备把这三个文件的内容都追加到testall.txt 中 test1.txt 1 2 3 4 5 6 test2.tx ...
- OpenGL程序无法启动此应用程序,因为计算机中丢失glut32.dll(转))
今天打开一个OpenGL源码,各种修改之后想要运行看一下效果,结果在我的开发环境下出现缺少相应的dll库: Windows7 64位+VS2010 提示:程序无法启动此应用程序,因为计算机中丢失glu ...
- python通过socket实现多个连接并实现ssh功能详解
python通过socket实现多个连接并实现ssh功能详解 一.前言 上一篇中我们已经知道了客户端通过socket来连接服务端,进行了一次数据传输,那如何实现客户端多次发生数据?而服务端接受多个客户 ...