You can pass objects using the request.setAttribute() / request.getAttribute() methods. In a JSP you can reach such an attribute by name, like this:
${requestScope.attributeName}
(replace "attributeName" with the name of your attribute).
How are you going to display the image? A response can have only one content-type, so if you want to output an image you can only output the image, you cannot output it within HTML content.
In my servlet, at some point I have(I'm using spring framework)
return new ModelAndView(getSuccessView(), "imageFile", imageFile);
and in the jsp
<c:out value="${imageFile}" />
but if imageFile is byte[] I wont get an image!!
Of course you don't.
The JSP displays textual data, you can NOT mix different types of data in a single stream and expect the browser to make sense of it all.
Instead you will need to have a servlet turn that byte array into an image format a browser can understand and put a link to that servlet into your JSP.
The same holds for ANY other data that's not flat text (effectively, anything that has a mimetype different from text/****).
The problem is that you need to clear that file up at some point.
You need some way of the data being kept for a certain amount of time and then expired (remember the user might refresh the page, or navigate back to it so the image may be requested more than once.)
I've done this by having a servlet generate the image based on some kind of key or sequence number passed in the query arguments of the image URL. You could, for example, store the data necessary to generate the image in sessiion, using a sequence number as part of the key.