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