解析HTML Thymeleaf页面时出错

时间:2017-11-23 20:07:34

标签: thymeleaf

由于某些原因,我的HTML不断抛出解析错误,更具体地说是“Exception解析文档:template =”find“,第69行 - 第17列”,我无法弄清楚为什么,首先关闭输入标签有帮助但是其余标签已正确关闭。这是HTML代码:

  <html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="layouts/layout"
  xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
</head>
<body>
  <div layout:fragment="content">
    <h1 data-th-text="#{application.title.h1}"></h1>
    <div th:replace="fragments/profile :: profile"></div>
    <div class="row">
      <div>
        <div>
          <ul>
            <li><a th:href="@{|/home-accueil|}" data-th-text="#{tab.pending}">Home</a></li>
            <li class="active" role="presentation"><span th:text="#{tab.find}">Quick find</span></li>
            <li role="presentation"><a th:href="@{|/updated|}" href="#" role="tab" aria-selected="true">Updated
                records</a></li>
          </ul>
          <div>
            <p th:text="#{item.agentName}">Text.</p>
            <div>
              <div>
                <label for="patent"></label>
                <div>
                  <label>Search</label> <input id="patent" type="text" value="" name="searchText" /> <span><a
                    href="#" id="buttonFind">View</a> </span>
                </div>
              </div>
            </div>
            <div>
              <div>
                <label><span>test2</span></label>
                <div>
                  <label>Search</label> <input id="trademark" type="text" value="" name="searchText" /> <span> <a
                    href="#" id="buttonFind2">View</a>
                  </span>
                </div>
              </div>
            </div>
            <hr>
            <div>
              <div>
                <div>
                  <label for="last">Last name</label> <input name="last" id="last" type="text" />
                </div>
                <div>
                  <label for="first">First name</label> <input name="j_password" id="first" type="password" />
                </div>
                <div>
                  <label for="firm">Firm name</label> <input name="firm" id="firm" type="password" />
                </div>
                <a href="#">Search</a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

<hr>是问题所在,它应该是<hr />代替,d-oh!