1 Reply Latest reply on Apr 18, 2012 9:20 PM by Luis Garcia

    SOLVED: a4j:mediaOutput - Error with Images larger than 2Kb

    Luis Garcia Newbie

       

      On a default JBoss 7.1.1 the following code won't display Images larger than 2Kb.

      It seems that Request is too big and the server does not see the HTTP/1.1

      I get a HEADER Response

      1. Request Method:GET
      2. Status Code:505 HTTP Version Not Supported

       

      I'm using the code from the RichFaces Showcase

       

      http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky

       

       

      <rich:dataTable value="#{tBean.files}" var="ff">

        <rich:column>

        <f:facet name="header">

                         Image

                      </f:facet>

        <a4j:mediaOutput element="img" mimeType="#{ff.contentType}"

        style="width:100px; height:100px;" createContent="#{tBean.paint}"

                                                        value="#{ff}" />

        </rich:column>

        </rich:dataTable>

       

      ===========================================================

       

                public void paint(OutputStream stream, Object object) throws IOException {

                          if(object instanceof TFile){

                                    TFile ff = (TFile) object;

                                    System.out.println("Writting: "+ ff.getFsName() + " Bytes: "+ ff.getSize());

                                    stream.write(ff.getData(),0, ff.getSize().intValue());

                          }

                          stream.close();

                }