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