I have a class with (amongst others) the field picture which is retreived from the database:
public class Person {
String name;
Blob picture;
}
So then I haven a controller where I add the person object to the model
@RequestMapping(value = "/online", method = RequestMethod.GET)
public String getCurrentUser(Model model) {
Person person = getMyPerson()
model.addAttribute("person", person);
return "online";
}
And finally I have a .jsp page to display the user:
<html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
..some tags
Persons name: ${person.name}
Persons picture: ?your_answer_here?
</html>
So the question (obviously) is how do I display the blob field as an image? I have tried and failed with . I really don't want to perform a new query to the database, I just want to display the image I already have ..