Thymeleaf 输出context path

在页面中

<th:action="@{/edit.html}" />
<a th:href="@{edit.html}"   />

在javascript中

<script th:inline="javascript">  
    function edit() {  
        var link = /*[[@{/edit.html}]]*/ 'test';  
        document.getElementById("user_form").action = link;  
    }  
</script> 

文本连接

无论是什么形式的文本:字面量’…’,变量表达式求值或消息表达式求值的结果,都可以用’+’进行连接

th:text="'The name of the user is ' + ${user.name}"