thymeleaf标签整理

来源:互联网 发布:淘宝电子商务运营模式 编辑:程序博客网 时间:2024/06/04 20:10

th:fragment 被调用的内容

<div th:fragment="prefectures">  <select th:if="${inputValue}" id="prefecture" name="prefecture" class="select_large" size="1">    <option th:each="job : ${prefectureInfoList}" th:value="${job.prefectureCd}" th:selected="${job.prefectureCd == inputValue.prefectureCd}" th:inline="text" th:class="${job.prefectureCd}">[[${job.prefectureNm}]]</option>  </select>

th:include 调用元
      <td align="left"  width="50%">        <div th:include="common/prefectures :: prefectures" style="display:inline"></div>        <font color="RED" size="-1"><b> *必須項目</b></font>        <input type="hidden" name="prefectureNm" id="prefectureNm" />        <input type="hidden" name="prefectureCd" id="prefectureCd" />      </td>

th:inline 让变量在文本框里现实 格式[[...]]


th:each 循环变量

th:each="job : ${prefectureInfoList}"

循环,job是页面侧的变量名,prefectureInfoList是java侧的变量名




原创粉丝点击