img not aparace using thymeleaf, spring boot (with maven)

0

The image I want to add is in the following directory:

/src/main/resources/static/images/logo.png

And the HTML tag looks like this:

<img width="220px" height="70px" th:src="@{/static/images/logo.png}"/> 

However, I get the following message when I try to access the image:

  

There was an unexpected error (type = Not Found, status = 404). No message   available

If you need to know, my index code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>Empresa | Simulado </title>
<link href="/static/images/favicon.ico" rel="icon" type="image/x-icon" />
</head>

<body>
    <br />
    <h1 align="center">Teste</h1>
    <img height="70px" width="220px" src="/static/images/logo.png" />

Ps: The favicon normally appears

    
asked by anonymous 21.10.2017 / 01:37

1 answer

0

Workaround for the problem, as described in the link: link

  

The static folder is not required in the path. You only need to use @ {/ images / logo.png}, because by default src/main/resources/static/ is /

    
23.10.2017 / 01:38