weilu2

将该内容放入一个空白的JSP文件中,保存为basepath.jsp,然后在需要引用的JSP文件中使用include标签引用。

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

 

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2021-11-30
  • 2022-12-23
  • 2021-11-30
  • 2021-11-29
  • 2021-07-19
猜你喜欢
  • 2021-12-10
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-05-26
  • 2021-12-10
  • 2022-02-07
相关资源
相似解决方案