Error in streaming dynamic resource - p:graphicImage
See original GitHub issue1) Environment
- PrimeFaces version: 6.2
- Application server + version: GlassFish 4.1
- Affected browsers: Firefox, Chrome
2) Expected behavior
Correctly display all system images.
3) Actual behavior
When I capture a “StreamedContent” the error is displayed in the server logs.
4) Steps to reproduce
Navigate through any screen with the image component.
5) Sample XHTML
<p:graphicImage value="#{gerPagDocImageBean.renderizaImagem}" rendered="#{loginBean.empresa.exibeLogoEmpresa}" width="150" cache="false" />
6) Sample bean
public StreamedContent getRenderizaImagem() throws IOException { FacesContext context = FacesContext.getCurrentInstance(); if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE || this.bytesImagem == null) { return new DefaultStreamedContent(); } InputStream is = new ByteArrayInputStream(this.bytesImagem); DefaultStreamedContent dsc = new DefaultStreamedContent(is); this.bytesImagem = null; return dsc; }
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
The exception seems unrelated
Not a bug and not related to StreamedContent. Also see: https://issues.apache.org/jira/browse/MYFACES-3736