8 Replies Latest reply on Jul 3, 2007 8:54 AM by Orsier Adrien

    s:fileUpload problem

    Orsier Adrien Newbie

      Hello.

      I'm having a problem using the s:fileUpload component, or more exactly the backing bean related to it, since I updated my application to the 1.3 (and later 2.0) version of Seam.


      JSF:

      <h:form enctype="multipart/form-data">
      
       <s:fileUpload id="data" data="#{uploadFile.data}" accept="*"
       contentType="#{uploadFile.dataContentType}" />
       <h:commandButton value="Upload" action="#{uploadFile.processData}"
       styleClass="registerButton" />
       </h:form>


      Basically, the 'processData' method is loaded after a lot of time when I push the button, like several seconds (if not minutes) after.

      Backing bean:
      @Name("uploadFile")
      public class UploadFile implements iUploadFile{
      
       private byte[] data;
      
       private String dataContentType;
       public void processData() {
       //my code to process the 'data' here.
       }
      
       /**
       * @return the data
       */
       @Lob
       public byte[] getData() {
       return data;
       }
      
       /**
       * @param data
       * the data to set
       */
       @Lob
       public void setData(byte[] data) {
       this.data = data;
       }
      
       /**
       * @return the dataContentType
       */
       public String getDataContentType() {
       return dataContentType;
       }
      
       /**
       * @param dataContentType
       * the dataContentType to set
       */
       public void setDataContentType(String dataContentType) {
       this.dataContentType = dataContentType;
       }
      
      }


      I added the @Lob annotation reading the seam doc, but I didn't have it before.
      Basically, the processData isn't called right after a click on the button, but after a huge delay, meanwhile I have a 'backing work' cursor, so the server still hasn't replied.