I have an image in byte representation and I need renders this image to JSP
page. I send the byte array to JSP through servlet.getOutputStream()
. How draw my image in a browser?
I send my byte[]
:
byte[] image = getDAO().getImage(propose.getId());
ServletOutputStream os = resp.getOutputStream();
os.write(image);
os.close();
How to render the image to JSP?
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Title</title>
</head>
<body>
...Somehow render get byte and render image ...
</body>
</html>