I have some problems presenting an image on frontend using spring mvc with hibernate to retrieve the image stored into a blob on database.
Entity:
@Lob
@Column(length = 100000)
private byte[] foto;
public byte[] getFoto() {
return foto;
}
public void setFoto(byte[] foto) {
this.foto = foto;
}
Controller:
@GetMapping("/view")
public ModelMap viewVehicle(@RequestParam(value = "id", required = false) Vehicle vehicle, Model model) {
if (vehicle == null) {
vehicle = new Vehicle();
}
return new ModelMap("vehicle", vehicle);
}
HTML:
But the view run without error's but the image not displayed.
I experimented a lot of solutions i've found on internet, but anything worked.
Any consideration to help-me resolve this situation?
Greetings