title: p:graphicImage with viewscoped
body: <p>page:</p>
  
  <pre><code>&lt;p:graphicImage value="#{testController.QR}" /&gt;
  </code></pre>
  
  <p>testController bean:</p>
  
  <pre><code>private StreamedContent QR;
  private ByteArrayOutputStream rawQR;
  
  public StreamedContent getQR() {
      if (rawQR != null) {
          rawQR = QRCode.from("test").to(ImageType.PNG).stream();
          ByteArrayInputStream is = new ByteArrayInputStream(rawQR.toByteArray());
          QR = new DefaultStreamedContent(is, "image/png");
          return QR;
      } else {
          return null;
      }
  }
  </code></pre>
  
  <p>I'm trying to display a QR image on the page.</p>
  
  <p>with SessionScoped the above code works, but with ViewScoped it displays a broken image icon, i need my bean to be ViewScoped. What am i missing here?</p>
  
  <p>QR Reference: <a href="http://viralpatel.net/blogs/create-qr-codes-java-servlet-qr-code-java/" rel="nofollow">http://viralpatel.net/blogs/create-qr-codes-java-servlet-qr-code-java/</a></p>