I am sorry that I need to ask this but I already spent three days trying to do this. I am buidling Java Web application and I want to include image to JSP page. Project name is realestates and I have Files folder inside realestates folder.
My code is like this:
<img alt="govno" src="<%=request.getContextPath() + "/Files/kurac.jpg"%>" style="width: 400px; height: 300px;">
This is what gets generated on page after I open it in browser:
<img alt="govno" src="/realestates/Files/kurac.jpg" style="width: 400px; height: 300px;">
BUT, image is not dispayed, only alt "govno" is written. I have tried many many paths (relative, absolute, changed folder structure million times and whatever I could think of and find on internet but nothing helped). Who would say that such a thing will be so hard to do???
Folder structure on Tomcat server after deployment is:
webapps
- realestates
|- WEB-INF
|- Files
|- kurac.jpg