回答

0

您可以使用th:inline將Javascript代碼內聯到您的HTML中。

考慮以下幾點:

<script th:inline="javascript"> 
    var timeout = [[${app.timeout}]]; 
</script> 

你必須爲應用程序創建與getter和setter屬性的屬性的類,你想使用Thymeleaf的${property}語法來訪問。

相關問題