Hi, how can I display on screen image stored in database? Anything from documentation didn’t help me…
public byte[] getProfileImage() {
return profileImage;
}
@Autowired
private Image<byte[]> image;
@Autowired
private InstanceContainer userDc;
[…]
UserDetails userDetails = currentAuthentication.getUser();
if (userDetails instanceof User) {
User currentUser = (User) userDetails;
image.setValueSource(new ContainerValueSource<>(userDc, “profileImage”));
}
This is only part of code I made. Saving works fine but I can’t convert it to display on screen.
I made a custom User Profile screen and my goal is to display current user’s image stored in db. Thats why I used userDetails in code.
I will appreciate any sort of help