I am trying to read an .html file from war file. I have used the code below, but it does not work.
Project structure:
Project
|_war
|_Pages
|_HtmlFiles
|_sample.html
My code:
InputStream inputStream = EmailMessages.class.getClassLoader()
.getResourceAsStream("/sample.html");
The root folder is on the classpath, so try this one: