<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

//  拼接绝对路径

 

当使用了相对路径  <base href="<%= basePath %>" />  后,全局都只能使用相对路径,

否则就会出现路径错误

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-12-26
  • 2022-12-23
  • 2022-01-03
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2022-01-12
  • 2021-07-20
  • 2022-12-23
  • 2021-09-20
相关资源
相似解决方案