0

I'm trying to use a p:graphicImage with an SVG in a streamed content. Right now I'm stuck 'cause if I set the entire path of the file, I'm able to see the image. If I use the StreamedContent (org.primefaces.model.StreamedContent) and I'll watch inside the Console source, I'm not able to see anything.

<p:graphicImage id="imgExpo_#{idPrefix}" value="#{bck.streamedImage}" cache="false" stream="true" > 

public StreamedContent getStreamedImage() {
    FacesContext context = FacesContext.getCurrentInstance();
    if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
        
        return defaultEmpty;
    }
    else {
        image =  new DefaultStreamedContent(BckUtils.getImageManager.getImageStream(context.getExternalContext().getRequestParameterMap() , user));
        return image;
    }
}

Anyone with some suggestions?

Thanks, Riccardo.

Primefaces 7.0

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Its probably your mime-type is wrong that it doesn't think its an SVG when streaming it? – Melloware Nov 19 '21 at 00:50
  • Hi @Melloware thank you for the responde. My mime type is correct and insert inside the web.xml, that's the code line svg image/svg+xml Any other suggestions? Thank you :D – Riccardo Fassina Nov 19 '21 at 10:56

0 Answers0