thymeleaf 获取项目路径 contextPath

thymeleaf 标签:


${#httpServletRequest.getContextPath()}

直接引用 th:οnclick="@{'location.href=\'' + ${#httpServletRequest.getContextPath()} + '/xxxx\'}"


其它:${#servletContext.contextPath} 



javascript中引用



你可能感兴趣的:(java,thymeleaf)