1 2 Previous Next 25 Replies Latest reply on Feb 23, 2007 2:03 AM by newlukai

    New fileUpload component

    shane.bryzak

      I've committed a basic working version of a fileUpload tag to CVS. It doesn't need all the additional jar files that the tomahawk component requires, and is greatly simplified from the 17 levels of abstraction that the Apache version implements. Usage is as such:

      page:

      <s:fileUpload id="picture" value="#{register.picture}"/>


      web.xml:
      <filter>
       <filter-name>Seam Multipart Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamMultipartFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>Seam Multipart Filter</filter-name>
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>


      action class:
      @Name("register")
      public class RegisterAction implements Register
      {
       private byte[] picture;
      
       public void setPicture(byte[] picture)
       {
       this.picture = picture;
       }
      
       public byte[] getPicture()
       {
       return picture;
       }
      }
      


      That's all there is to it. It doesn't do anything fancy yet such as progress notification, etc, or for that matter even store the filename. It would be nice though if someone could give it a try and report back any issues/feature requests either in this thread, or on the following JIRA page:

      http://jira.jboss.org/jira/browse/JBSEAM-630

      Thanks!

        1 2 Previous Next