Problema FileUpload no Visual JSF

Olá pessoal,

To tentando montar uma aplicação web usando o FileUpload do richFaces no Visual JSF.

Porém a página de upload não funciona.

To postando o código abaixo, caso vocês possam dar um help.

Classe FileUploadBean:

package teste;

import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;

import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;

public class FileUploadBean {
private ArrayList files = new ArrayList();

public int getSize() {
      return getFiles().size();
}

public FileUploadBean() {
}

 public void listener(UploadEvent event) throws Exception{
    UploadItem item = event.getUploadItem();
    File file = new File();
    file.setLength(item.getData().length);
    file.setName(item.getFileName());
    file.setData(item.getData());
    files.add(file);
}

public String clearUploadData() {
    files.clear();
    return null;
}

public String processFiles() {
    return "process";
}

public ArrayList<File> getFiles() {
    return files;
}

public void setFiles(ArrayList<File> files) {
    this.files = files;
}

public String getFileNames() {
    StringBuffer result = new StringBuffer();
    for(File file : files) {
        if (result.length() > 0) {
            result.append(',');
        }
        result.append(file.getName());
    }
    return result.toString();
}

}

Classe File:

package teste;

public class File {

private String Name;
private String mime;
private long length;
private byte[] data;

public byte[] getData() {
    return data;
}

public void setData(byte[] data) {
    this.data = data;
}

public String getName() {
    return Name;
}

public void setName(String name) {
    Name = name;
    int extDot = name.lastIndexOf('.');
    if (extDot > 0) {
        String extension = name.substring(extDot + 1);
        if ("bmp".equals(extension)) {
            mime = "image/bmp";
        } else if ("jpg".equals(extension)) {
            mime = "image/jpeg";
        } else if ("gif".equals(extension)) {
            mime = "image/gif";
        } else if ("png".equals(extension)) {
            mime = "image/png";
        } else {
            mime = "image/unknown";
        }
    }
}

public long getLength() {
    return length;
}

public void setLength(long length) {
    this.length = length;
}

public String getMime() {
    return mime;
}

}

Tela de Upload

<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root version=“2.1” xmlns:f=“http://java.sun.com/jsf/core
xmlns:a4j=“http://richfaces.org/a4j
xmlns:c=“http://java.sun.com/jsp/jstl/core
xmlns:h=“http://java.sun.com/jsf/html
xmlns:jsp=“http://java.sun.com/JSP/Page
xmlns:rich=“http://richfaces.org/rich
xmlns:webuijsf=“http://www.sun.com/webui/webuijsf”>
<jsp:directive.page contentType=“text/html;charset=ISO-8859-1” pageEncoding=“ISO-8859-1”/>
<f:view>
<webuijsf:page id=“page1”>
<webuijsf:html id=“html1”>
<webuijsf:head id=“head1”>
<webuijsf:link id=“link1” url="/resources/stylesheet.css"/>
</webuijsf:head>
<webuijsf:body id=“body1” style="-rave-layout: grid">
<webuijsf:form id=“form1”>
<h:panelGrid columnClasses=“top,top” columns=“2”>
<rich:fileUpload allowFlash=“false” fileUploadListener="#{fileUploadBean.listener}"
id=“upload” immediateUpload=“true” maxFilesQuantity=“10”>
<a4j:support event=“onuploadcomplete” reRender=“info”/>
</rich:fileUpload>
<h:panelGroup id=“info”>
<rich:panel bodyClass=“info”>
<f:facet name=“header”>
<h:outputText value=“Uploaded Files Info”/>
</f:facet>
<h:outputText rendered="#{fileUploadBean.size==0}" value=“No files currently uploaded”/>
<rich:dataGrid columns=“1” rowKeyVar=“row” value="#{fileUploadBean.files}" var=“file”>
<rich:panel bodyClass=“rich-laguna-panel-no-header”>
<h:panelGrid columns=“2”>
<h:outputText value=“File Name:”/>
<h:outputText value="#{file.name}"/>
<h:outputText value=“File Length(bytes):”/>
<h:outputText value="#{file.length}"/>
</h:panelGrid>
</rich:panel>
</rich:dataGrid>
</rich:panel>
<rich:spacer height=“3”/>


<h:commandButton action="#{fileUploadBean.clearUploadData}" rendered="#{fileUploadBean.size>0}" value=“Clear Uploaded Data”/>
<h:commandButton action="#{fileUploadBean.processFiles}" rendered="#{fileUploadBean.size>0}" value=“Process files”/>
</h:panelGroup>
</h:panelGrid>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>

//web.xml

<?xml version="1.0" encoding="UTF-8"?> javax.faces.STATE_SAVING_METHOD client com.sun.faces.validateXml true com.sun.faces.verifyObjects true UploadFilter com.sun.webui.jsf.util.UploadFilter The maximum allowed upload size in bytes. If this is set to a negative value, there is no maximum. The default value is 1000000. maxSize 1000000 The size (in bytes) of an uploaded file which, if it is exceeded, will cause the file to be written directly to disk instead of stored in memory. Files smaller than or equal to this size will be stored in memory. The default value is 4096. sizeThreshold 4096 RichFaces Filter richfaces org.ajax4jsf.Filter createTempFiles false maxRequestSize 80000000 UploadFilter Faces Servlet richfaces Faces Servlet REQUEST FORWARD INCLUDE Faces Servlet javax.faces.webapp.FacesServlet javax.faces.LIFECYCLE_ID com.sun.faces.lifecycle.PARTIAL 1 ExceptionHandlerServlet com.sun.errorhandler.ExceptionHandler errorHost localhost errorPort 24444 ThemeServlet com.sun.webui.theme.ThemeServlet Faces Servlet /faces/* ExceptionHandlerServlet /error/ExceptionHandler ThemeServlet /theme/* 30 faces/upload.jsp javax.servlet.ServletException /error/ExceptionHandler java.io.IOException /error/ExceptionHandler javax.faces.FacesException /error/ExceptionHandler com.sun.rave.web.ui.appbase.ApplicationException /error/ExceptionHandler *.jspf true

//------Faces Config --------///

<?xml version='1.0' encoding='UTF-8'?> richFacesBean org.my.richfaces.RichFacesBean session SessionBean1 novoteste.SessionBean1 session ApplicationBean1 novoteste.ApplicationBean1 application RequestBean1 novoteste.RequestBean1 request fileUploadBean teste.FileUploadBean session anotherBean teste.AnotherBean request upload novoteste.upload request

Se alguém puder dar um help.

Obrigada.