I'm running demo project from ZK and try to add image tag and find this problem I have two tag
1. <div style="background-image: url('img/zklogo3.png');padding:0px 0px 0px 0px;">
2. <image src="~./img/zklogo3.png" width="100px"/>
The image 2 can show on the screen and being resolved with this URL:
http://localhost:8080/zkres/web/6cbcf362/img/zklogo3.png
but the one in style can not resolve and return error not found, URL: http://localhost:8080/img/zklogo3.png, if I copy and append /zkres/web/6cbcf362 to the URL then it can show successfully
Any one, know how to solve it?
In a
Spring bootproject, in order to configurestatic filesincludingimagesyou need to have a class that implementsWebMvcConfigurer. Please check below example:Sample Project structure
Then you can simply display images like this in your
HTMLfiles.Reference doc: Spring WebMvcConfigurer