I'm sorry that I need to ask about this, but I've been trying to do this for three days now. I am creating a Java Java application and I want to include an image in a JSP page. The project name is realestates, and I have a Files folder inside the realestates folder.
My code looks like this:
<img alt="govno" src="<%=request.getContextPath() + "/Files/kurac.jpg"%>" style="width: 400px; height: 300px;">
This is what is created on the page after it is opened in the browser:
<img alt="govno" src="/realestates/Files/kurac.jpg" style="width: 400px; height: 300px;">
BUT, the image is not sent, only "govno" is recorded. I tried many different paths (relative, absolute, altered folder structure millions of times and all that I could think of and find on the Internet, but nothing helped). Who would say that such a thing would be so hard?
Folder structure on a Tomcat server after deployment:
webapps - realestates |- WEB-INF |- Files |- kurac.jpg
source share