script中
<script> var contextPath= [[@{/}]]; </script>
html中,以form為例,將form前面新增"th:",其中“/account/index”為controller裡定義的路徑
<form id="loginForm" th:action="@{/account/index}" method="post" class="form-horizontal form-group"> </from>
script中
<script> var contextPath= [[@{/}]]; </script>
html中,以form為例,將form前面新增"th:",其中“/account/index”為controller裡定義的路徑
<form id="loginForm" th:action="@{/account/index}" method="post" class="form-horizontal form-group"> </from>