I'm trying to read in an html file as a string using InputStream but no matter what I try I keep getting a null pointer exception. The File I am trying to read is at "/war/index.html" and the code to read it in looks like this:
File f = new File(path);
ServletContext context = getServletContext();
InputStream is = context.getResourceAsStream(f.getAbsolutePath());
int data = is.read();
As soon as I call is.read() it gives me a NullPointerException. Any help is appreciated thanks!