I am trying to write a jsp function that will take the path to a text file as an input, then print the lines of the text file to the webpage.
The following error is thrown: "out cannot be resolved"
<%! public void displayData(String file){
BufferedReader reader = new BufferedReader(new FileReader(file));
String line;
while ((line = reader.readLine()) != null) {
out.print(line);
}
reader.close();
}%>
<% displayData(application.getRealPath("/") + "../../test.txt"); %>
What am I doing wrong?
Thank you in advance