[jboss-cvs] jboss-seam/src/ui/org/jboss/seam/ui ...

Shane Bryzak Shane_Bryzak at symantec.com
Tue Jan 23 00:19:54 EST 2007


  User: sbryzak2
  Date: 07/01/23 00:19:54

  Modified:    src/ui/org/jboss/seam/ui  FileUpload.java
  Log:
  separate value bindings for data, content type and filename
  
  Revision  Changes    Path
  1.2       +14 -2     jboss-seam/src/ui/org/jboss/seam/ui/FileUpload.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FileUpload.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/FileUpload.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- FileUpload.java	22 Jan 2007 16:19:19 -0000	1.1
  +++ FileUpload.java	23 Jan 2007 05:19:54 -0000	1.2
  @@ -5,6 +5,7 @@
   import javax.faces.component.UIComponentBase;
   import javax.faces.context.FacesContext;
   import javax.faces.context.ResponseWriter;
  +import javax.faces.el.ValueBinding;
   
   import org.jboss.seam.servlet.MultipartRequest;
   
  @@ -29,9 +30,20 @@
         {
            MultipartRequest req = (MultipartRequest) request;
            
  -         byte[] fileData = req.getFileBytes(getClientId(context));
  -         
  -         getValueBinding("value").setValue(context, fileData);
  +         String clientId = getClientId(context);
  +         byte[] fileData = req.getFileBytes(clientId);
  +         String contentType = req.getFileContentType(clientId);
  +         String fileName = req.getFileName(clientId);
  +         
  +         getValueBinding("data").setValue(context, fileData);
  +         
  +         ValueBinding vb = getValueBinding("contentType");
  +         if (vb != null)
  +            vb.setValue(context, contentType);
  +         
  +         vb = getValueBinding("fileName");
  +         if (vb != null)
  +            vb.setValue(context, fileName);
         }      
      }
         
  
  
  



More information about the jboss-cvs-commits mailing list