不同系统之间获取路径的分隔符的兼容(转换)
String path= request.getSession( ).getServletContext( ).getRealPath( "/" );//获取绝对路径
String path2 = path.replace("\\",File.separator);//用File.separator 代替 分隔符 以适应各个系统(Windows,Linux)
String path= request.getSession( ).getServletContext( ).getRealPath( "/" );//获取绝对路径
String path2 = path.replace("\\",File.separator);//用File.separator 代替 分隔符 以适应各个系统(Windows,Linux)