SpringBoot,Thymeleaf

时间:2018-04-12 04:51:02

标签: html thymeleaf

有人可以解释一下我在做什么吗? 我使用百里香和springboot 我有模板文件

out.html



<html lang="en" xmlns:th="http:www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>SAD</title>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>
</head>
<body>
<h1>sad</h1>

<div class="container">
    <div th:if="${not #lists.isEmpty(list)}">
        <h2>People to deport</h2>
        <table class ="table table-striped">

            <tr>
                <th>Name</th>
                <th>Surname</th>
                <th width="100px">Age</th>
            </tr>

            <tr th:each = "people :${list}">
                <td  th:text="${people.name}"></td>
                <td  th:text="${people.surname}"></td>
                <td  th:text="${people.age}"></td>
            </tr>
        </table>
    </div>
</div>
<p th:text="#{hello}">text</p>


</body>
</html>
&#13;
&#13;
&#13;

我的控制器上有请求映射。它工作正常。但正如你所看到我使用资源包而我的默认语言是俄语。 (它已经在那个地方显示了&#39;?&#39;标志。)

&#13;
&#13;
<p th:text="#{hello}">text</p>
&#13;
&#13;
&#13;

所以我想在我的页面上显示俄语内容。我将字符集从UTF-8改为UTF-16,一切都崩溃了。实际上编码类型并不重要,因为我试图用charset = ISO-8859-1

来做到这一点

服务器启动,显示其他模板。但即使我将UTF-8字符集重新打开并重新启动服务器,该程序也无效。

我解决了它: 我从中复制了我的HTML; 2.删除文件并创建新命名的out.html; 3.在文件中输入html并且它可以正常工作。

那么有人可以解释发生了什么吗?

0 个答案:

没有答案
相关问题