这是我的文件夹中的项目
找不到在NetBeans文件+ GlassFish项目
我想读取文件书form.html这是我的项目的目录网页和把它放在一个串。
这是我打电话给我的功能“getFileContent”:
String content = getFileContent("web/book-form.html");
这是函数:
public String getFileContent(String filePath){
String line, content = new String();
try {
File file = new File(filePath);
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
while((line = br.readLine()) != null){
content += line;
}
br.close();
fr.close();
} catch(IOException e){
System.out.println(e.getMessage());
}
return content;
}
我的问题是,NetBeans的告诉我,它无法找到我的文件,书本 - form.html
任何想法?
怎样的NetBeans告诉你。请将错误消息stacktrace添加到问题中。 – unwichtich