Я пытаюсь сохранять файлы в мою папку «ProfileImages», который проживает в WebContent/Servlet относительный путь «Путь не найден»
Когда я бегу с ниже пути я получаю файл не найден исключения
String appPath = request.getServletContext().getRealPath("/");
String savePath = appPath + "WebContent" + File.separator + "ProfileImages";
System.out.println(appPath + "WebContent" + File.separator + "ProfileImages");
печать дает:
C:\Users\me\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\Test\WebContent\ProfileImages\image.jpg (path not found)
http://stackoverflow.com/questions/12160639/what-does-servletcontext-getrealpath-mean-and -when-should-i-use-it –