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中 ...
随机推荐
- MVC框架的主要问题是什么?
以下是MVC框架的一些主要问题: 对 DOM 操作的代价非常高 程序运行缓慢且效率低下 内存浪费严重 由于循环依赖性,组件模型需要围绕 models 和 views 进行创建
- 常忘知识点三-使用选择器继承来精简CSS --- @extend
推荐一个很详细的sass教程:https://www.sass.hk/docs/ 在设计网页的时候常常遇到这种情况:一个元素使用的样式与另一个元素完全相同,但又添加了额外的样式.通常会在 HTML 中 ...
- MyBatis:MyBatis操作MySQL存储过程
一 . 数据库中创建存储过程,并查看创建结果 1.创建存储过程 DROP procedure IF EXISTS net_procedure_request; DELIMITER $$ )) BEGI ...
- You are using the runtime-only build of Vue where the template compiler is not available. Either pre
在升级脚手架到vue-cli3.0版本的时候出现了这个报错: [Vue warn]: You are using the runtime-only build of Vue where the tem ...
- Git: git tag 使用小结(给发布版本打标记,切换并修改某个历史版本)
通常在软件发布的时候会打一个tag,用于标注这次发布的相关信息, 这样做的好处是,将来如果这个版本出现了问题,可以通过tag迅速定位到当前版本,进行错误修复. 1. 新建tag $ git tag v ...
- ZingChart line 折线图表数据设置
根据 x 坐标和 y 坐标一一对应进行设置 (x,y) { "type": "line", "series":[ {,],[,],[,],[ ...
- openresty开发系列20--lua的时间操作
openresty开发系列20--lua的时间操作 在 Lua 中,函数 time.date 和 difftime 提供了所有的日期和时间功能.在 OpenResty 的世界里,不推荐使用这里的标准时 ...
- ubuntu挂载新硬盘
root@luo-All-Series:~# fdisk -lDisk /dev/loop0: 320.2 MiB, 335728640 bytes, 655720 sectorsUnits: sec ...
- 【Java】阿里巴巴Java开发手册
阿里巴巴Java开发手册 下载地址:https://github.com/alibaba/p3c 阿里巴巴代码规范检查插件p3c 下载地址:https://github.com/alibaba/p3c
- pix2pix&Cycle GAN&pix2pix HD
这里简短地谈一下如题的三篇论文: 参考:https://blog.csdn.net/gdymind/article/details/82696481 (1)pix2pix:从一张图片生成另一张图片 p ...