I’m having some trouble getting the primefaces dyanmic graphic image to display for a certain scenario where I’m trying to display an image on a facelet page (retrieved from a database) and the page is invoked by a URL (not h:commandLink). It works on other pages with requests processed through h:commandButton. However all the data but the image appears for the following scenario...
fundraiseView.xml (facelet page) html ... p:graphicImage value="#{fundraisePage.picture}"/ ... /html
FundraisePage (request scoped backing bean with request param)
@ManagedBean @RequestScoped public class FundraisePage extends BackingBean { @EJB DataSBLocal dataSB; StreamedContent picture; @ManagedProperty(value="#{param.id}") private int id; @PostConstruct public void init() { this.fundRaiseEO = dataSB.getFundRaiseIndividual(id); InputStream inputStream = new ByteArrayInputStream(this.fundRaiseEO.getPicture()); this.setPicture(new DefaultStreamedContent(inputStream, "image/jpeg")); }When I invoke the page via http://...../faces/fundraiseView.xml?id=1 the page returns displaying all the data for id 1 but without displaying the picture. I’m sure it has to do with how I’m calling the page (since I have it working else where) however I need it to be a request initiated outside a JSF wrapped tag.
Any insight or suggestions very much appreciated.
Thanks, Johnathan