I have a Spring Boot Application in which i store images under src/main/webapp/resources/images
.
When i run the Spring Boot Application as a standalone application with an embedded Tomcat Server i was able to display the image in my html-page (a .jsp to be precise) with the following code:
<img src="src/main/webapp/resources/images/example.png">
For different reasons i have to deploy the Spring Boot application as a .war on a WildFly server. After doing so, the images are not showing anymore.
I checked the .war and saw that the resources
-folder was moved to root in the war.
I tried all of the following, but none of them seem to work:
<img src="resources/images/example.png">
<img src="/resources/images/example.png">
<img src="<%=request.getContextPath() %>/resources/images/example.png">
Do you have any idea which path i have to use? Or do i have to move the images into a different folder?
Thanks.