AnsweredAssumed Answered

Dashlet file upload

Question asked by legendre on Oct 11, 2007
Latest reply on Oct 15, 2007 by gavinc
Hi all,

I have created a dashlet jsp page where I need to submit a binary file with tomahawk JSF extention.
I added bean in faces-config-bean.xml and did not change web.xml

All textfields are catched by the bean except the binary file !

Any ideas?

Thanks for your help

JSP code :

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%>

   <h:inputText id="title" value="#{MyBean.title}" />
   
   <h:inputText id="description" value="#{MyBean.description}" />
   
   <x:inputFileUpload id="file" value="#{MyBean.file}" storage="file"/>
       
   <h:commandButton actionListener="#{MyBean.submit}" action="submit" value="submit" />


Bean code :


import org.apache.myfaces.custom.fileupload.UploadedFile;

public class MyBean {

   private String title;
   private String description;
   private UploadedFile file;   

   public void submit(javax.faces.event.ActionEvent e)
   {
      // todo
   }
   
   public UploadedFile getFile() {
      return file;
   }
   
   public void setFile(UploadedFile file) {
      this.file = file;
   }
   
   public String getTitle() {
      return title;
   }
   
   public void setTitle(String title) {
      this.title = title;
   }
   
   public String getDescription() {
      return description;
   }
   
   public void setDescription(String description) {
      this.description = description;
   }
   
}

Outcomes