0

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?

  • Hello, it seems that your path is wrong, static files never will be served from /api/user/filename automatically. So either you've added custom path for static files OR you need to set correct path. Please update your question with more context – Jacouille Sep 22 '22 at 13:35
  • You should put your image in **META-INF/resources/api/user/image.jpg** . Also if **api** is your context path then put your image in **META-INF/resources/user/image.jpg** – pvrforpranavvr Jun 25 '23 at 17:36

1 Answers1

0

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">

ko.alen
  • 18
  • 4
  • The problem was that the image needed to be in the same path within the resources path, for example if I used the image in a template rendered in the path "api/user/test", the image would need to be in "META-INF/resources/api/user/image.jpg. – Ricardo Waldow Sep 24 '22 at 05:03