zoukankan      html  css  js  c++  java
  • thymeleaf+layui 展示table 报500

    使用thymeleaf和layui的时候,使用layui的表格方法渲染,thymeleaf出现了渲染错误,报错信息如下:
    org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "
     
                    {checkbox: true, fixed: true}
                    , {field: 'originalFileName', title: '文件名', 400, sort: true}
                    , {field: 'fileType', title: '文件类型', 100}
                    , {field: 'fileSize', title: '文件大小', 110, sort: true}
                    , {field: 'createTime', title: '上传时间', 170, sort: true}
                    , {field: 'dpStatus', title: '数据处理状态', 122, templet: '#statusTpl', sort: true}
                    , {field: 'updateTime', title: '数据处理完成时间', 170, templet: '#updateTimeTpl', sort: true}
                    , {fixed: 'right', title: '操作', align: 'center', 300, toolbar: '#operating'}
     
                " (template: "textManagement" - line 125, col 22)
    解决方案很简单:
     
     ,cols: [
    [
     
          {field:'id', title: 'ID', sort: true}
          ,{field:'username', title: '用户名'} //width 支持:数字、百分比和不填写。你还可以通过 minWidth 参数局部定义当前单元格的最小宽度,layui 2.2.1 新增
          ,{field:'sex', title: '性别', sort: true}
          ,{field:'city', title: '城市'}
          ,{field:'sign', title: '签名'}
          ,{field:'classify', title: '职业', align: 'center'} //单元格内容水平居中
          ,{field:'experience', title: '积分', sort: true, align: 'right'} //单元格内容水平居中
          ,{field:'score', title: '评分', sort: true, align: 'right'}
          ,{field:'wealth', title: '财富', sort: true, align: 'right'}
     
        ]
    ]
    也就是把cols后的[[ ]]变为
    [
        [
        ]
    ]
    因为[[…]]之间的表达式在thymeleaf被认为是内联表达式,所以渲染错误
    ---------------------
    作者:rjkkaikai
    来源:CSDN
    原文:https://blog.csdn.net/rjkkaikai/article/details/80452128
  • 相关阅读:
    使用JFileChooser实现在指定文件夹下批量添加根据“数字型样式”或“非数字型样式”命令的文件夹
    51Nod 1376 最长递增子序列的数量 (DP+BIT)
    POJ 2728 Desert King (最优比率树)
    UVa 11280 Flying to Fredericton (DP + Dijkstra)
    UVa 11367 Full Tank? (DP + Dijkstra)
    UVa 10269 Adventure of Super Mario (Floyd + DP + BFS)
    UVaLive 4452 The Ministers' Major Mess (TwoSat)
    UVa 11294 Wedding (TwoSat)
    HDU 3247 Resource Archiver (AC自动机+BFS+状压DP)
    HDU 5957 Query on a graph (拓扑 + bfs序 + 树剖 + 线段树)
  • 原文地址:https://www.cnblogs.com/wwqqnn123456/p/9970571.html
Copyright © 2011-2022 走看看