传统的jsp页面js获取项目路径的写法:
var contextPath = '${pageContext.request.getContextPath()}';
使用thymeleaf是这样获取的:
<script th:inline="javascript">
var context = [[@{/}]];
</script>
传统的jsp页面js获取项目路径的写法:
var contextPath = '${pageContext.request.getContextPath()}';
使用thymeleaf是这样获取的:
<script th:inline="javascript">
var context = [[@{/}]];
</script>