在jsp页面中:
<%
String path = application.getRealPath("").replace("\\","\\\\");
%>
在java代码中:
String path = request.getServletContext().getRealPath("").replace("\\","\\\\");
在jsp页面中:
<%
String path = application.getRealPath("").replace("\\","\\\\");
%>
在java代码中:
String path = request.getServletContext().getRealPath("").replace("\\","\\\\");
转载于:https://www.cnblogs.com/nizuimeiabc1/p/8854148.html