I have a simple JavaEE web application project in Intellij and I need to read a file in src.main.resources folder. Follow is a screen shot of what my project looks like.
I need to return the context of data.txt file in the getData() function. Current method does nothing but return "Error" to the index.jsp and throw a NoSuchFileException. I tested using following paths but result is the same.
"data.txt"
"/data.txt"
"src/main/resources/data.txt"
"/src/main/resources/data.txt"
Any help would be greatly appreciated.

 
     
    

 
    