해결할 수없는 문제가 있습니다. 속성 파일을 읽어야하지만 올바른 경로를 설정할 수 없습니다. java.io.File에 대한 문서에서 src/...에서 설정해야한다고 말하고 있습니다. ... 현재 작동하지 않으며 같은 파일에서 경로를 만들었습니다.속성 파일의 올바른 경로를 설정하는 방법은 무엇입니까?
예외입니다 : FileNotFound
PropertyReader 클래스 : C에서
@RequestMapping(value = "/result", method = RequestMethod.GET)
public String resultPage(ModelMap model) {
//Getting property with key "path"
model.addAttribute("path", new PropertyReader().getProperties(file).getProperty("path"));
return "result";
내가하고 있어요 경우 경로 : PropertyReader 사용
public final class PropertyReader {
private Properties prop = new Properties();
private InputStream input = null;
public Properties getProperties(File file) {
try {
input = new FileInputStream(file);
// load a properties file
prop.load(input);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (null != input) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return prop;
}
}
그리고 ApplicationController.class : // .. 잘 작동합니다.

당신을 주셔서 감사하고 좋은 하루 되세요!
는 속성을 작성 했는가 자원 폴더 –
에 파일을 넣어 당신' 파일 '개체 – Sanjeev
파일 파일 = 새 파일 ("여기에 파일 경로"); –