I am trying to display a which is stored in a database.
I have a <o:graphicImage value="#{image.getById(1)}" />
.
Note: The ID (1) is only for testing.
My property looks like:
@Lob
private byte[] image;
and my dao/service is this:
@Name
@ApplicationScoped
public class Images {
@Inject
private UserDAO userDAO;
public byte[] getById(int id) {
return userDAO.getUserByID(id).getImage();
}
To the concrete problem:
I just implemented this and the image is displayed correctly. I set the image manually to NULL
in the database.
My assumption: The image is not found and the image is not displayed (or the typical 'image is not found'-image.).
But: The old image is displayed. Even after a restart of the server and a clean. Nothing changed. I tried to upload an other image to the database - same result.
What is the problem here? Where is my fault? How can I fix this?