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中 ...
随机推荐
- oracle tablespace pctfree pctused
二.oracle pctfree和pctused详解 一.建立表时候,注意PCTFREE参数的作用 PCTFREE:为一个块保留的空间百分比,表示数据块在什么情况下可以被insert,默认是10,表示 ...
- 使用Git GUI,上传项目到github,并实现预览功能
一.使用GUI,上传项目到GitHub (GUI是啥,不做过多赘述,可百度了解) 步骤: 1.打开GUI,新建一个仓库,demo 2.在编辑器中,编写相关代码,比如添加1.html文件,文件内容为“h ...
- Eclipse创建的Java Web项目,如何启用外置浏览器访问jsp或者html页面
当我们用Eclipse创建了一个Java Web项目,想访问一个jsp或者html页面时,通常会在目标页面(以jsp为例)上点击鼠标右键,选择[Run As]——>[Run on Server] ...
- hadoop 参数调优重点参数
yarn的参数调优,必调参数 28>.yarn.nodemanager.resource.memory-mb 默认为8192.每个节点可分配多少物理内存给YARN使用,考虑到节点上还 可能有其 ...
- MXNet/Gluon 中网络和参数的存取方式
https://blog.csdn.net/caroline_wendy/article/details/80494120 Gluon是MXNet的高层封装,网络设计简单易用,与Keras类似.随着深 ...
- VsCode写Python代码!这代码简直和大神一样规范!太漂亮了!
VsCode写Python代码!这代码简直和大神一样规范!太漂亮了! 转 https://www.jianshu.com/p/636306763d89 VsCode虽然没有Pycharm的功能齐 ...
- c# list 使用Where()方法过滤数据
//根据任务id过滤数据 Func<RfidCodeResultDto, bool> expression = c => c.lineTaskId == _lineTaskId; r ...
- intellij maven配置与使用
目录 intellij maven配置与使用 Maven 常用设置介绍 Maven 骨架创建 Java Web 项目 Maven 组件来管理项目 @(目录) intellij maven配置与使用 M ...
- Python - Django - CSRF
CSRF 攻击: 把 settings.py 中的 csrf 注释掉 正规网站: 创建修改密码页面 password.html: <!DOCTYPE html> <html lang ...
- CompletableFuture Quasar 等并发编程
CompletableFuture基本用法 https://www.cnblogs.com/cjsblog/p/9267163.html Quasar https://blog.csdn.net/ma ...