I am novice in Java and I am currently working in Eclipse Kepler. I have a JSP page from where I am reading a text file which is continuously being written using a shell script.
<b>
<%
String filePath = "/home/default/test.txt";
BufferedReader reader = new BufferedReader(new FileReader(filePath));
StringBuilder sb = new StringBuilder();
String line;
while((line = reader.readLine()) != "Success"){
sb.append(line+"\n");
out.println(sb.toString());
}
%>
</b>
I need the logic to keep reading the log until it reads the final "Success" string and until it doesn't, it should not print any blank rows.
How to solve it?