[TOC]

1、thymeleaf&jsp

2、javascript

function getContextPath() {
var pathName = document.location.pathname.substring(1);
var ctxPath = !!!pathName ? ‘’ : pathName.substring(0, pathName.indexOf(‘/‘));
return ctxPath;
}