头部引入了thymeleaf

  1. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

在html中使用

  1. <div><input value="${abilityName}"/></div>

页面展示

经排查,使用方法不对

因为每个模板有自己的取值语法,thymeleaf用的是下面这种

  1. <div><input th:value="${abilityName}"/></div>

在js中调用方式,已一个ajax请求参数为例

  1. $.ajax({
  2.  
  3. url:'/ability/listChartData',
  4.  
  5. type:'post',
  6.  
  7. async : true,
  8.  
  9. dataType:"json",
  10.  
  11. data:{
  12.  
  13. 'abilityName':`[[${abilityName}]]`,
  14.  
  15. 'calType':`[[${calType}]]`
  16.  
  17. },
  18.  
  19. success:function(data){
  20.  
  21. myChart.hideLoading();
  22.  
  23. // 使用刚指定的配置项和数据显示图表。
  24.  
  25. myChart.setOption({
  26.  
  27. legend: {
  28.  
  29. data: data.legendData,//data.legendData,
  30.  
  31. selected: data.selected
  32.  
  33. },
  34.  
  35. series: [{
  36.  
  37. data: data.seriesData,
  38.  
  39. }]
  40.  
  41. });
  42.  
  43. },
  44.  
  45. error:function(){
  46.  
  47. myChart.hideLoading();
  48.  
  49. }

Thymeleaf模板引擎与springboot关联后,在html中无法使用el表达式获取model存的值的更多相关文章

  1. Thymeleaf模板引擎的初步使用

    在springboot中,推荐使用的模板引擎是Thymeleaf模板引擎,它提供了完美的Spring MVC的支持.下面就简单的介绍一下Thymeleaf模板引擎的使用. 在controller层中, ...

  2. SpringBoot使用thymeleaf模板引擎

    (1).添加pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactI ...

  3. (二)SpringBoot基础篇- 静态资源的访问及Thymeleaf模板引擎的使用

    一.描述 在应用系统开发的过程中,不可避免的需要使用静态资源(浏览器看的懂,他可以有变量,例:HTML页面,css样式文件,文本,属性文件,图片等): 并且SpringBoot内置了Thymeleaf ...

  4. 【Springboot】Springboot整合Thymeleaf模板引擎

    Thymeleaf Thymeleaf是跟Velocity.FreeMarker类似的模板引擎,它可以完全替代JSP,相较与其他的模板引擎,它主要有以下几个特点: 1. Thymeleaf在有网络和无 ...

  5. SpringBoot入门篇--使用Thymeleaf模板引擎进行页面的渲染

    在做WEB开发的时候,我们不可避免的就是在前端页面之间进行跳转,中间进行数据的查询等等操作.我们在使用SpringBoot之前包括我在内其实大部分都是用的是JSP页面,可以说使用的已经很熟悉.但是我们 ...

  6. SpringBoot:2.SpringBoot整合Thymeleaf模板引擎渲染web视图

    在Web开发过程中,Spring Boot可以通过@RestController来返回json数据,那如何渲染Web页面?Spring Boot提供了多种默认渲染html的模板引擎,主要有以下几种: ...

  7. 九、SpringBoot集成Thymeleaf模板引擎

    Thymeleaf咋读!??? 呵呵,是不是一脸懵逼...哥用我的大学四级英文知识告诉你吧:[θaimlif]. 啥玩意?不会音标?...那你就这样叫它吧:“赛母李府”,大部分中国人是听不出破绽的.. ...

  8. SpringBoot--- Shiro(拦截,认证)、Thymeleaf(模板引擎)

    SpringBoot--- Shiro(拦截,认证).Thymeleaf(模板引擎) 环境 IDEA :2020.1 SpringBoot: 2.3.3 Java : 8 版本依赖: ​ shiro- ...

  9. 三、thymeleaf模板引擎构建前台html, 后台使用 ModelAndView 和 Model 模型

    项目源码:https://github.com/y369q369/springBoot.git      ->     thymeleaf 私聊QQ: 1486866853 1.pom.xml中 ...

随机推荐

  1. R Shiny app | 交互式网页开发

    网页开发,尤其是交互式动态网页的开发,是有一定门槛的,如果你有一定的R基础,又不想过深的接触PHP和MySQL,那R的shiny就是一个不错的选择. 现在R shiny配合R在统计分析上的优势,可以做 ...

  2. HTMLPage测试js通过ajax调用

    HTMLPage测试js通过ajax调用接口 <!DOCTYPE html> <html lang="en" xmlns="http://www.w3. ...

  3. php异步处理

    <?php namespace Index\Controller; use Core\Controller; class test extends Controller { public fun ...

  4. GPS 经纬度

      经纬度地图: http://www.gpsspg.com/maps.htm http://www.gzhatu.com/dingwei.html 经纬度格式转化 http://www.gzhatu ...

  5. 目标检测标注工具labelImg安装及使用

    目标检测中,原始图片的标注过程是非常重要的,它的作用是在原始图像中标注目标物体位置并对每张图片生成相应的xml文件表示目标标准框的位置.本文介绍一款使用方便且能够标注多类别并能直接生成xml文件的标注 ...

  6. 廖雪峰Git教程1

    转自:https://www.liaoxuefeng.com/wiki/896043488029600 [安装Git] 最早Git是在Linux上开发的,很长一段时间内,Git也只能在Linux和Un ...

  7. 算法习题---5.12城市正视图<离散化应用>(Uva221)*****

    一:题目 给定n坐房子的西南角坐标x, y.还有宽度w,长度d(其实没用),高度h.问从南面看过去能看到几座房子. 城市俯视图和主视图 注意: 输出主视图中能够看到的所有建筑物按照左下角x坐标从小到大 ...

  8. k8s记录-ntpd时间同步配置(五)

    1)服务端配置 在192.168.0.1 root用户下操作 yum install -y ntp ntpdate 修改etc/ntp.conf 注释所有的server和restrict 加入: se ...

  9. 【443】Tweets Analysis Q&A

        [Question 01] When converting Tweets info to csv file, commas in the middle of data (i.e. locati ...

  10. SpringBoot中日志配置

    背景 由于一些框架中还使用log4j-1.x系列陈旧的日志框架,调试过程中有一些错误信息不能在控制台显示,增加了调试成本.以下配置方法 将帮助你获得log4j-1.x日志在控制台显示. 解决方法: 使 ...