获取项目根路径

传统的jsp页面js获取项目路径的写法:

var contextPath = '${pageContext.request.getContextPath()}';

使用thymeleaf是这样获取

<script>
    var ctx = "[[@{/}]]";
 </script>

猜你喜欢

转载自www.cnblogs.com/3xiaoleilei/p/12084368.html