Hi All
I have written JSP to read a text file(Text file and JSP are in same location) and display the data. when I am trying to run the JSP it is displaying "Error:Null".
here is my code
<%
try{
java.net.URL url =config.getServletContext().getResource("/textfile.txt");BufferedReader buffreader =new BufferedReader(new InputStreamReader(url.openStream()));
String strLine;
while ((strLine = buffreader.readLine()) != null)
{
out.println(strLine);
}
}catch (Exception e){
System.err.println("Error: " + e.getMessage());
}
%>
Thanks in Advance.