6 Replies Latest reply on Feb 20, 2007 6:38 PM by shane.bryzak

    fileUpload (integrated component)

    aaston

      I'm having trouble with "s:fileUpload". In particular, I'm getting:

      java.lang.NullPointerException
      at org.jboss.seam.ui.FileUpload.decode(FileUpload.java:52)

      My view page is straight JSP (no Facelets; I haven't gone there with Seam yet). The tag instance is:

      <s:fileUpload data="#{manager.mergeData}" />

      FileUpload, lines 51 and 52 are:

      ValueBinding dataBinding = getValueBinding("data");
      Class cls = dataBinding.getType(context);

      So, it would seem that the binding to propery 'data' is either not working, or retrieving the binding doesn't work.

      Any ideas? I'm stuck, and will soon have to resort to Tomahawk ...

      Aaron.

        • 1. Re: fileUpload (integrated component)
          face4web

          I had exactly the same problem when I upgraded from Seam 1.1.5GA to 1.1.6GA. I downgrade again to 1.1.5GA and now it works again? Hope this may help you!

          Kind Regards

          • 2. Re: fileUpload (integrated component)
            shane.bryzak

            I've modified the FileUpload tag to do a null check on the data valuebinding, if you could check this with the latest CVS version it would be great.

            • 3. Re: fileUpload (integrated component)
              aaston

              I downgraded to 1.1.5; it behaves the same way for as does 1.1.6.

              Shane, I grabbed the source from CVS (the head). The code now doesn't throw a NullPointerException, but I also can't get at the uploaded data. The ValueBinding for "data" is null.

              I'm trying to upload (for now) to a byte[]. I have the following in my JSP view:

              <s:fileUpload data="#{jobform.mergeData}" />
              <h:outputText value="#{jobform.mergeData}"/>

              The outputText tag renders ... so why is the "data" ValueBinding null?

              I've got to be missing something ... it's my first Seam project, so I am it won't really surprise me.

              Aaron.

              • 4. Re: fileUpload (integrated component)
                aaston

                I have the same problem with the properties of fileUpload; I can't seem to get a value binding for fileName either. I modified the JSP tag to:

                <s:fileUpload data="#{jobform.mergeData}" fileName="#{jobform.mergeDataFilename}"/>

                On the other hand, I have an h:inputText tag. It's value is updated in the 'backing bean' (a Seam Stateful Session bean).

                Why would only the UI tags be 'broken' ? The fileUpload control renders correctly; I can browse for a filename etc.

                I'm lost.

                • 5. Re: fileUpload (integrated component)
                  aaston

                  This works as advertised if I use Facelets as my view technology. It does not work with JSP or JSPX.

                  I intended to use Facelets anyway ... I just hadn't tried it with Seam yet.

                  • 6. Re: fileUpload (integrated component)
                    shane.bryzak

                    I'm not sure why it doesn't work with your jsp page. If you raise an issue in JIRA and assign it to me I'll take a look at it.