zoukankan      html  css  js  c++  java
  • thymeleaf使用实例

    map取值遍历,dicts为map<string,Object>类型。 

     <option th:each="dict :${dicts['mpsTypes']}" th:value="${dict!=null}?${dict.id}:''" th:text="${dict!=null}?${dict.name}:''"
                                                     th:checked="${dict.id}==${oc.configType}"></option>
    

      

    报错处理

    2020-07-08 16:09:09.189 ERROR 14376 --- [nio-8083-exec-2,,,,] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8083-exec-2] Exception processing template "org/orgConfig": Exception evaluating SpringEL expression: "oc.systemCode" (org/orgConfig)
    2020-07-08 16:09:09.192 ERROR 14376 --- [nio-8083-exec-2,,,,] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "oc.systemCode" (org/orgConfig)] with root cause

    org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'systemCode' cannot be found on null

    1.注意对象是否为空

    2.注意命名是否冲突,是否正确

    3.遍历内容多时,可以通过删除排查报错行

    4.看下html标签是否符合规范,我的出现问题的原因是table里,tr外卖套了div循环,后来改成tbody就可以了。唉,这个问题坑了我一天。

  • 相关阅读:
    高进度乘法FFT优化
    Activity的四种加载模式
    异步任务AsyncTask
    利用Handler在子线程中更新UI
    Android 屏幕旋转监听
    HDOJ-1698-线段树成段更新
    HDOJ-1671-字典树
    HDOJ-1251 字典树
    python数据结构与算法
    find the lowest number location
  • 原文地址:https://www.cnblogs.com/tong2018/p/13267439.html
Copyright © 2011-2022 走看看