在jsp页面中:
<%
String path = application.getRealPath("").replace("\\","\\\\");
%>
在java代码中:
String path = request.getServletContext().getRealPath("").replace("\\","\\\\");
在java web中获取该项目的根路径
阅读 111
2023-05-11
在jsp页面中:
<%
String path = application.getRealPath("").replace("\\","\\\\");
%>
在java代码中:
String path = request.getServletContext().getRealPath("").replace("\\","\\\\");
相关推荐
精彩评论(0)