1 Reply Latest reply on Nov 17, 2009 5:35 PM by Ladislav Matis

    MultipartRequest handling after upload invoked by applet

    Ladislav Matis Newbie

      Hello !

      I'm trying to handle MultipartRequest after upload invoked by Jumploader applet. This applet's providing multi files uploading.
      So here is my scenario:

      My snippet of ScanHome.xhtml:

      <!-- JumpLoader -->
      <applet name="jumpLoaderApplet"
           archive="/odkup-war/applet/messages_sk.zip, /odkup-war/applet/jumploader_z.jar"
           width="100%" height="500">
      <param name="uc_uploadUrl" value="/odkup-war/UHTest.seam?actionName=UPLOAD" />
      <param name="uc_resumeCheckUrl" value="/odkup-war/UHTest.seam?actionName=RESUME" />

      Notice two important params - uc-uploadUrl and uc-resumeCheckUrl. These params hold values of URL which are called to fire upload/resume.

      My snippet of web.xml

        <filter-name>Seam Filter</filter-name>
        <filter-name>Seam Filter</filter-name>
      <filter-name>Seam Multipart Filter</filter-name>
        <filter-name>Seam Multipart Filter</filter-name>

      Enabled multipart filter.

      My snippet of components.xml

      <web:multipart-filter create-temp-files="true" max-request-size="1000000" url-pattern="*.seam" />

      Enabled multipart filter with create-temp-files set to true.

      UHTest.xhtml is empty file only with composition tag, here is snippet of UHTest.page.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <page view-id="/UHTest.xhtml" action="#{Uhtest.someAction()}">

      When UHTest is fired from jumploader applet, action Uhtest.someAction() is called to handle multipart form request

      My snippet of UHTest.java

      public class UHTest { .....
      public void someAction(){
        FacesContext ctx = FacesContext.getCurrentInstance();
        org.jboss.seam.web.MultipartRequest request = (org.jboss.seam.web.MultipartRequest)ctx.getExternalContext().getRequest();
        //Check parameters inside of request - should be 7, but list is empty
        Enumeration en = request.getParameterNames();
          Object param = (Object) en.nextElement();
          System.out.println(param+" - "+request.getParameter(param.toString()));
        //Calling file param - returns --- BINARY DATA ---
        //Returns NULL :o(

      Result is following:

      1. File(s) are uploaded correctly to temporary folder ! It's name is something like 1234-5678.upload.

      2. When I cast request to MultipartRequest there is no exception.


      1. I cannot receive list of parameters inserted to multi-part form by applet.

      2. The most important thing - I cannot recieve bytes of uploaded file !!

      What is wrong ?
      Is such a approach correct ? I'm not really sure about UHTest.page.xml approach to call java method ...

      Thank you for your reply.