jsffile-uploadrichfacesgatein

rich:fileUpload within GateIn portlet


Environment: RichFaces 3.3.3 Final; Facelets 1.1.15; JBoss portletbridge 2.1.0 Final; GateIn Portal 3.1.0 as bundled with JBoss AS 5.1 and the Mojarra JSF 1.2 which is built in.

Some code snippets: filepage.xhtml:

 <a4j:form id="fileForm">
      <rich:fileUpload fileUploadListener="#{testBean.fileListener}"
        acceptedTypes="txt" maxFilesQuantity="1" />
      <!-- etc. -->
 </a4j:form>

TestBean.java:

 public void fileListener(UploadEvent e) throws IOException {
    System.out.println("Entering the fileListener Method");
    UploadItem item = e.getUploadItem();
    File file = item.getFile();
            // etc...
}

Result when deployed as a stand-alone web app is as expected, the component displays, user clicks add, browses then selected a file, file is added to the list, user clicks upload button, and the line "Entering the fileListener Method" displays on the console (along with other things happening).

Result on GateIn: All of the above EXCEPT the sysout and other code in the listener. It appears that this method is not getting called.

I have already spent a few days reading through JBoss community forums and a few JIRAs, and it seems my problem is not new. I tried each of the suggestions I found, but none worked for me. Also, none of these posts were more recent than Jan 2010, and all of the constituent parts of my app have had new versions since then.

Your assistance, or a pointer to up-to-date and detailed information, is greatly appreciated.


Solution

  • I located in the documentation for Red Hat EPP that file upload is not supported. Perhaps when the next version is ready (to support JSF 2, Richfaces 4, and Bridge 3) then it will be, but for now, the work-around is the only choice.