<a th:href="${#httpServletRequest.getContextPath()}"></a>
如Web项目名称为Demo,那么${#httpServletRequest.getContextPath()}获取到的值为Demo