Search code examples
javahtmlimagequarkusquarkus-reactive

Quarkus: Qute Template Static Images Source Path


I am making a Qute Template and there is a logo image in the header that I need to have loaded.

The path that is being used within the html is this: <img style="width: 10cm;" src="logo.png" alt="Logo Flower">

The image path from the main folder is resources/META-INF/resources/logo.png.
Click here to see the folders.

When the template is rendered, the image is not loaded and shows an error on the GET request:

GET http://localhost:8080/api/user/logo.png 404 (Not Found)


Does anyone have an answer on how to put the path of static files correctly in Qute templates?


Solution

  • It seems your HTTP path is wrong. It should look like this: GET http://localhost:8080/logo.png

    Try to inspect (CTRL + I) your page go to sources and try to figure out where is the problem...

    Here is example on my project: META-INF/resources/logo.png resources path , and here is my img tag <img id="logo" src="logo.png" alt="Logo">