title: The UploadedFile is null , Primefaces
body: <p>The UploadedFile is null when I clicked the commandButton. What's Wrong?
   in the form tag i insert the code : enctype="multipart/form-data"</p>
  
  <pre><code> &lt;h:form  enctype="multipart/form-data"&gt;
       &lt;p:fileUpload  mode="simple"  value="#{b_cargar_tbl.file}" /&gt;
           &lt;p:commandButton actionListener="#{b_cargar_tbl.upload()}"  value="Send" ajax="false" /&gt;
   &lt;/h:form&gt;
  </code></pre>
  
  <p>The code of bean is:</p>
  
  <pre><code>private UploadedFile file;
  
  public UploadedFile getFile() {
      return file;
  }
  
  public void setFile(UploadedFile file) {
      this.file = file;
  }
  
  public void upload() {
      if(file != null) {
          FacesMessage message = new FacesMessage("Succesful", file.getFileName() + " is uploaded.");
          FacesContext.getCurrentInstance().addMessage(null, message);
      }
  }
  </code></pre>
  
  <p>The web.xlm</p>
  
  <pre><code>  &lt;context-param&gt;
      &lt;param-name&gt;primefaces.UPLOADER&lt;/param-name&gt;
      &lt;param-value&gt;auto|native|commons&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.primefaces.webapp.filter.FileUploadFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
  &lt;/filter-mapping&gt;
  </code></pre>