I want to serve an image saved as a blob in a MySQL Database through hibernate3 in a JSF application. My intention is that /myapp/image/get.faces?id=x will serve the image saved in ...
/myapp/image/get.faces?id=x
public void uploadFile(ActionEvent evt)throws Exception{ InputFile inputFile=(InputFile)evt.getSource(); byteArrayOutputStream=new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream=new ObjectOutputStream(byteArrayOutputStream); objectOutputStream.writeObject(inputFile.getFile()); reportTemplate.setTemplatePath(inputFile.getFilename()); reportTemplate.setTemplateData(Hibernate.createBlob(byteArrayOutputStream.toByteArray())); ...