【问题标题】:Thymeleaf Spring updating table without reloading pageThymeleaf Spring 更新表而不重新加载页面
【发布时间】:2015-12-20 19:27:26
【问题描述】:

我有一个表,其中的一些行需要每 x 秒更新一次。 一行不断要求更新,直到收到某个值。

我已经阅读了有关片段的内容,但我需要更具体的示例。

我想学习如何在不使用 javascript/AJAX 的情况下实现这种行为(我已经知道它们)。

<table>
     <tr> <!--If simulation.completed=false, this row need to be updated-->
        <td th:text="${simulation.completed}"></td> <!--(true or false)-->  
        <td .... </td> <td>....
     </tr>
     <tr> <!--If simulation.completed=false, this row need to be updated-->
        <td th:text="${simulation.completed}"></td> <!--(true or false)-->  
        <td .... </td> <td>....
     </tr>
     <tr> <!--If simulation completed=false, this row need to be updated-->
        <td th:text="${simulation.completed}"></td> <!--(true or false)-->  
        <td .... </td> <td>....
     </tr>
</table>

【问题讨论】:

    标签: spring spring-mvc thymeleaf


    【解决方案1】:

    你不能只用 Thymeleaf 做到这一点。 Thymeleaf 是服务器端的。它将呈现页面,您的应用程序将页面发送到客户端。您需要使用 JavaScript 等客户端脚本来执行此操作。

    【讨论】:

      猜你喜欢
      • 2019-07-10
      • 1970-01-01
      • 1970-01-01
      • 2018-11-15
      • 1970-01-01
      • 2013-01-24
      • 1970-01-01
      • 1970-01-01
      • 2012-04-26
      相关资源
      最近更新 更多