Hi i have a method which returns 'image' and i need to display the same image in UI and am using jsf1.2 , icefaces 1.8.2 , Jboss seam.
Am adding the snippet i used to display image in UI, but am unable to get image in UI.
In XHTML page :-
Thanks in advance :-)
Am adding the snippet i used to display image in UI, but am unable to get image in UI.
Code:
public BufferedImage imageReturn(String taskId) throws IOException {
byte[] bytes;
EntityManager em = (EntityManager) Component.getInstance("entityManager");
System.out.println("Task ID : " + taskId);
bytes = (byte[]) em.createQuery("select t.image from Task t where t.taskId = " + taskId).getSingleResult();
System.out.println("bytes---> " + Arrays.toString(bytes));
InputStream inputStream = new ByteArrayInputStream(bytes);
BufferedImage image = ImageIO.read(inputStream);
return image;
Code:
<tr> <td >
Signature
</td> <td> <h:graphicImage id="image" alt="signature could not be found" value="#{taskHome.imageReturn(taskHome.instance.taskId)}" /> </td>
Comment