3 Replies Latest reply on Mar 11, 2013 12:41 PM by gimbal2

    <t:inputFileUpload> Null File problem

      Hi all;
      i am developing a JSF portlet project (JSF 2.0 and Portal 7), I am trying to use the <t:inputFileUpload> tag but it always gives me a null Value for the uploaded file, can any onne help me with this?

      the web.xml file contains the required filter mapping
           <filter-name>Extensions Filter</filter-name>
           <filter-name>Extensions Filter</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
      and the jsp code is as follows:

      <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
      <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <h:form enctype="multipart/form-data">
                <f:selectItems id="testLookup"     value="#{LookupsManagedBean.faqCategories}" />
      <h:commandButton action="#{AuthoringContentBean.testDB}"></h:commandButton>
           <t:inputFileUpload value="#{AuthoringContentBean.uploadedFile}" />
           <h:commandButton styleClass="ShortButton" type="submit" value="add" action="#{AuthoringContentBean.uploadContentFile}"></h:commandButton>

        • 1. Re: <t:inputFileUpload> Null File problem
          Did you try to google for "t:inputFileUpload null"? You are not the first one to run into this. Apparently there are plenty of ways to make the component fail to deliver. You should exhaust your options first before asking here - this is not a MyFaces forum (and tomahawk is part of MyFaces). You may just want to try to ask in the MyFaces mailing lists.

          In the future you should make your information more complete. Are you using Mojarra or MyFaces? Which version of Tomahawk? Also, please use \
           tags when posting code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
          • 2. Re: <t:inputFileUpload> Null File problem
            First of all, thanks for your reply
            I really did my best trying to solve this before posting my question, all of what i found did not solve my problem, they all said that the problem is either related to the "enctype" of the form or to missing extensionFilter mapping in web.xml. but both cases are correct with me i did declare the filter and specified the enctype.
            I am working with MyFaces, the follwoing are the JARS i am using
            • 3. Re: <t:inputFileUpload> Null File problem
              Yeah, so wrong forum. Like I said: try the Apache myfaces mailing lists.


              Now if you have generic JSF API questions, feel free to ask them. But for help with specific APIs, implementations and frameworks not related to Oracle, always look for a forum or mailing list that deals with that product. Or try Stackoverflow which is a more general purpose site that is actually designed to manage such a chaotic "ask anything you want" environment. Its not that you're doing anything illegal by posting here, its simply in your own best interest to maximize the chance of getting an actual answer.