title: Primefaces file upload not working
body: <p>Trying to get jsf fileUploadListener to work just does not seem to do anything trying to just get a printline when hitting {fileUploadView.handleFileUpload} nothing seems to be happening.
  UI loads up fine on localhost:8080/index.jsf after clicking on choose file I select a file then after pressing upload button nothing happens no errors in logs or print lines printing everything from display point of view seems to be fine. </p>
  
  <p>index.xhtml</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://xmlns.jcp.org/jsf/html"
            xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
            xmlns:f="http://xmlns.jcp.org/jsf/core"
            xmlns:p="http://primefaces.org/ui"&gt;
  
          &lt;link type="text/css" rel="stylesheet" href="/project/faces/javax.faces.resource/theme.css?ln=primefaces-glass-x" /&gt;
  
          &lt;f:view&gt;
              &lt;h:head&gt;
                  &lt;meta charset="utf-8" /&gt;
  
                  &lt;title&gt;test&lt;/title&gt;
              &lt;/h:head&gt;
  
  
              &lt;h:body&gt;
                  &lt;h:form&gt;
                      &lt;p:fileUpload fileUploadListener="#{fileUploadView.handleFileUpload}" mode="advanced" dragDropSupport="true"
                                    update="messages" sizeLimit="100000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" /&gt;
  
                      &lt;p:growl id="messages" showDetail="true" /&gt;
                  &lt;/h:form&gt;
              &lt;/h:body&gt;
          &lt;/f:view&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>FileUploadView.java (bean)</p>
  
  <pre><code>import javax.faces.application.FacesMessage;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  import javax.faces.context.FacesContext;
  
  import org.primefaces.event.FileUploadEvent;
  import org.primefaces.model.UploadedFile;
  
  @ManagedBean
  @ViewScoped
  public class FileUploadView {
  
      private UploadedFile uploadedFile;
  
      public void handleFileUpload(FileUploadEvent event) {
          System.out.println("handel file upoad =-=-=-=-=-");
          FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
          FacesContext.getCurrentInstance().addMessage(null, message);
      }
  
      public UploadedFile getUploadedFile() {
          System.out.println("uploading file get =-=-=-=");
          return uploadedFile;
      }
  
      public void setUploadedFile(UploadedFile uploadedFile) {
                  System.out.println("uploading file set =-=-=-=");
  
          this.uploadedFile = uploadedFile;
      }
  
  
  }
  </code></pre>