获取本地项目

xiaoxiao2021-02-27  185

Java code ? 1 2 3 4 String path = request.getContextPath(); String basePath = request.getScheme() +  "://"          + request.getServerName() +  ":"  + request.getServerPort()          + path +  "/" ; 再在JS中调用: JavaScript code ? 1 2 var  basePath =  '<%=basePath%>' ; alert(basePath);  //http://localhost:8080/
转载请注明原文地址: https://www.6miu.com/read-12941.html

最新回复(0)