Women in Technology

Hear us Roar



Article:
  Upload Files with JSF and MyFaces
Subject:   Upgraded version problem
Date:   2006-08-03 05:04:28
From:   radha_thegr8
This example fails for Tomahawk 1.1.3, and myfaces 1.1.3 versions.


Did anyone try ?

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Upgraded version problem
    2006-09-20 08:21:21  JBuilderDoug [View]

    It's no help, but I think I've tried just about everything and have not been able to convert from 1.1.1 to 1.1.3 as far as inputFileUpload is concerned. I've been trying it in JBuilder and JDeveloper.

    I've been trying to use only Tomahawk with standard JSF. I've not trie using complete myfaces and tomahawk. Here's what I've tried

    1) Configured libraries for tomahawk-1.1.3.jar and Framework for the t: taglib (The JBuilder IDE recognizes/displays the t: taglab elements
    2) Included this .jar with my project
    3) Made the .jsp enctype="multipart/form-data"
    4) Included in the .jsp
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
    5) Entered the <t:inputFileUpload statement.... />
    6) imported org.apache.myfaces.custom.fileupload.UploadedFile; into my Bean.
    7) Placed the ExtensionsFilter in my web.xml file.

    <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>maxFileSize</param-name>
    <param-value>20m</param-value>
    <description>Set the size limit for uploaded files.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    </filter>

    <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
    <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>

    <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
    <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>

    Everything seems fine syntaxwise according to the IDE and there are no build errors. At runtime I get

    NoClassDefFoundError

    org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance...
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter...

    so it appears that my filter is faulty and can't be called.