1 Reply Latest reply on Oct 24, 2012 9:14 AM by Volker Schmidt

    s:fileUpload does not work in SEAM 2.2.0

    Ellen Liu Newbie

      Newbie here. Search through the Internet and could not find any helpful answer yet..

       

      I have tried to implement a simple file upload functionality. We use JBOSS 5.0.1 and SEAM 2.2.0

       

      First I tried <s:fileUpload> tag follow the documentation of SEAM 2.2.0. However, the upload file is always null. I have set break point in the FileUploadRederBase.doDecode() and find the request was not treaded as MultipartRequest. Could not figure out why? Does <s:fileUpload> real works for SEAM2.2.0 and JBOSS 5.0.1.

       

      Here is the related code:

       

      web.xml:

       

      <filter>

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

        <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>

      </filter>

        <filter-mapping>

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

        <url-pattern>/*</url-pattern>

      </filter-mapping>

      ---------------------------------------------------------------

      Component.xml:

      <component class="org.jboss.seam.web.MultipartFilter">

        <property name="createTempFiles">false</property>

      --------------------------------------------------------------------

       

      BRFileUpload.xhtml

       

      <rich:panel style="border-style : none;" headerClass="title-section">
        <h:panelGrid  columns="1" width="50%">
           <h:form id="fileULForm" enctype="multipart/form-data">
              <s:fileUpload styleClass="submit_button_small_upload"
                  id="lqgFile" data="#{bRFileController.upLoadFile}"
                  fileName="#{bRFileController.upLoadFileName}"
                  contentType="#{bRFileController.fileContentType}" />
              <h:commandButton value="Import LQG Files"
                  styleClass="submit_button_small_white"
                  actionListener="#{bRFileController.saveFileDB}" />
              </h:form>
      ...
      </h:panelGrid>
      </rich:panel>

       

      ---------------------------------------------------------------------------

      BRFileController.java(){

       

          private byte[] upLoadFile;

          private String upLoadFileName;

          private String fileContentType;

       

          public void setUpLoadFile(byte[] upLoadFile) {
              this.upLoadFile = upLoadFile;
          }

        • 1. Re: s:fileUpload does not work in SEAM 2.2.0
          Volker Schmidt Newbie

          I'm using Seam 2.3 on JBoss 7.1, the only difference is that I'm using ICEfaces 3.1.0 instead of Richfaces. The ICEfaces ace:fileEntry component is not working, so I tried with the s:fileUpload-component, but it still doesn't work.

           

          I have exactly the same problem. My request is not treated as multipart request, regardless the surrounding form is multipart or not. Did you solve the problem or are there any updates or other comments on this issue?