1、在页面中 th:action="@{/edit.html}" /> <a th:href="@{edit.html}" /> 2、在javascript中 [javascript] view plain copy <script th:inline="javascript"> function edit() { var link = /*[[@{/edit.html}]]*/ 'test'; document.getElementById("user_form").action = link; } </script>