title: UploadedFile is null when submit jsf upload request with Tomahawk
body: <p>trying to upload a file on a facelets page using Tomahawk2.0 1.1.11. But I get a null pointer exception and I see in the debugger, the uploadedFile variable is not being set in the bean.  Any ideas why the bean isn't being set?  The t:inputFileUpload component is otherwise rendering and functioning as I would expect.</p>
  
  <p>page:</p>
  
  <pre><code>&lt;h:form enctype="multipart/form-data"&gt;
  &lt;t:inputFileUpload value="#{Bean.uploadedFile}" /&gt;
  &lt;h:commandButton type="submit" id="Submit" value="Submit" action="#{Bean.submit}"/&gt;
  &lt;h:messages /&gt;  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>bean:</p>
  
  <pre><code>protected UploadedFile uploadedFile;
  public UploadedFile getUploadedFile() { return this.uploadedFile; }
  public void setUploadedFile(UploadedFile uploadedFile) {
  this.uploadedFile = uploadedFile;}
  
  public String submit()  throws IOException { 
  String fileName = FilenameUtils.getName(uploadedFile.getName()); // exception here!!
  String contentType = uploadedFile.getContentType();
  byte[] bytes = uploadedFile.getBytes();
  FacesContext.getCurrentInstance().addMessage(null, 
  new FacesMessage(String.format("File '%s' of type '%s' successfully uploaded!", 
  fileName, contentType)));
  
  return "success";     
  }
  </code></pre>
  
  <p>The exception happens on the first line of submit.  In the debugger I see that uploadedFile is null.  The jsf page looks fine and I can use the browse button to choose a file.  After I press submit I see uploadedFile in the bean is null.</p>
  
  <p>Error message:</p>
  
  <pre><code>16:06:59,699 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Framework].[Faces Servlet]] (http--127.0.0.1-8080-2) Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException
      at net.gui.bean.Bean.submit(Bean.java:118) [classes:]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_30]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_30]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_30]
      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_30]
      at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final] 
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357) [tomahawk20-1.1.11.jar:] 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final] 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at net.gui.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:34) [classes:] 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final] 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at net.gui.filter.NAISAuthFilter.doFilter(NAISAuthFilter.java:59) [classes:] 
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final] 
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final] 
      at java.lang.Thread.run(Thread.java:662) [:1.6.0_30]
  </code></pre>
  
  <p>web.xml:</p>
  
  <pre><code>&lt;filter&gt;
  &lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.apache.myfaces.webapp.filter.ExtensionsFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;    
  
  &lt;filter&gt;
      &lt;filter-name&gt;NaisAuth&lt;/filter-name&gt;
      &lt;filter-class&gt;net.gui.filter.NAISAuthFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;NaisAuth&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;filter&gt;
  &lt;filter-name&gt;HibernateFilter&lt;/filter-name&gt;
  &lt;filter-class&gt; net.gui.filter.HibernateSessionRequestFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;HibernateFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>