Thymeleaf / Loading image from DTO
Hello guys, I'm trying to make a profile manager for any user that is successfully identified, I can render every user datas in my template except for my image, in my inspector it says
the image can't load
The image comes from my DTO and it's persisted in my database and I have implemented my getters and setters properly but I still don't know why it doesn't work.
In my browser it obviously shows Image de profil
Here's my code in my template :
14 Replies
⌛
This post has been reserved for your question.
Hey @NoSung! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Show the DTO user please.
Can you give an example what is inside the image-string?
This is a simple image in jpg
persisted in my db
You mean the raw bytes of the image as an string?
I don't know what you mean by raw bytes, but yes I typed it in string. I wasn't supposed to do it this way ?
also I'm trying to learn thymeleaf and I'm new to Spring Boot so maybe there's some notions I misunderstood
Sorry, you need to give an exact example of one image-string.
You mean from my db ?
Yes
I have one image called
jiri.jpg
and that's it no other images💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
@Peter Rader I changed my image type in my entities and DTO to bytes, people recommended me to do that
but with the code I have in my template and how I have this image, this shouldn't be an issue to display it
I ask chatGPT and it says I don't need an URL if this comes from my db
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.