use the getter method to display the image

Without knowing what the error is… one thing that is incorrect is the way you are using variables in your @{...} expression. If you want to use a variable expression, the correct way is:

<img th:src="@{${user.imageName}}"/>

You can also just omit the @{...}, depending on the value of imageName.

<img th:src="${user.imageName}"/>

(And getImageName() is equivalent to .imageName.)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top