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>

 

posted on 2024-04-29 00:29  le.li  阅读(2)  评论(0编辑  收藏  举报