在html中用js代替${pagecontext.request.getcontextpath}这样就不用使用jsp了


  var pathArray = window.location.pathname.split('/');
  var secondLevelLocation = pathArray[1];
  var loginUrl = window.location.protocol + "//"  + window.location.host + "/"+ secondLevelLocation;

  

原文地址:https://www.cnblogs.com/itniwota/p/8075296.html