1.th:href

获得当前的根路径 th:href="@{/}"

2.select输出并自动选中

<select class="form-control select2" id="stage2CoachID" name="stage2CoachID"
     th:value="${class.stage2CoachID}">
     <option value="">请选择</option>
     <th:block th:each="entityCoach : ${listEntityCoach}">
         <option th:value="${entityCoach.coachID}" th:text="${entityCoach.userName}"
                 th:selected="${entityCoach.coachID == class.stage2CoachID}">教练名称</option>
     </th:block>                               

</select>

3.map方法

判断是否有指定key值时,必须用get方法,不能用[]

正确写法:

th:class="${mapTeachTrain.get(key)}!=null?${mapTeachTrain.get(key)}:'book'"

错误写法

th:class="${mapTeachTrain[key]}!=null?${mapTeachTrain[key]}:'book'"

key是定义的一个变量,完整代码:

<td th:with="key=${car.carID+'-'+car.coachID+'-'+detail.startTime+'-'+detail.endTime}"
th:class="${mapTeachTrain.get(key)}!=null?${mapTeachTrain.get(key)}:'book'"
th:data="${key}" th:id="${car.carID+detailStat.index}"></td>

最新文章

  1. 学习 opencv---(5) 创建Trackbar(活动条) &amp;图像对比度,亮度值调整
  2. js localStorage 设置和取值
  3. BZOJ2448 : 挖油
  4. document的createDocumentFragment()方法
  5. iOS button 里边的 字体的 摆放
  6. .NET中Debug模式与Release模式
  7. ubuntu cpus 共享打印
  8. mysql 导出过长的数字列时变科学计数法问题解决办法
  9. EF Code First:实体映射,数据迁移,重构(1)
  10. Mysql SQL优化&amp;执行计划
  11. java静态代理与动态代理简单分析
  12. VMware系统运维(七)vCenter Inventory Server安装
  13. java 计算器SWT/RAP(版本3)键盘鼠标兼容
  14. 腾讯云(centos)上安装apache
  15. 苹果试图做?XCode6 放弃prefix.pch档
  16. 《解决在Word中为汉子插入拼音及音标的问题》
  17. 文本三剑客---sed 基础
  18. vb.net MakeWParam
  19. DOS简单文件指令
  20. 前端 html css

热门文章

  1. 错误 1 未能找到类型或命名空间名称“DataPager”(是否缺少 using 指令或程序集引用?)
  2. 修改VS 2012调试默认浏览器
  3. ext Ext.grid.去除右边空白
  4. 微信接口 output {&quot;errMsg&quot;:&quot;translateVoice:fail, the permission value is offline verifying&quot;}
  5. springboot-01 helloworld
  6. 关于PHP建立数据库访问类的封装以及操作php单例模式连接数据库封装类
  7. oracle行转列函数以及一些窗口函数(PIVOT ,OVER)
  8. 360doc个人图书馆解决复制问题
  9. 剑指Offer-表示数值的字符串
  10. whatis命令,一个非常有用的命令