1 Reply Latest reply on Apr 12, 2011 10:30 AM by arturo eduardo cabrera cordoba

    rich:fileUpload not call fileUploadListener

    Victor Augusto Zago Menegusso Newbie

      Hello

      I have the following problem, rich:fileUpload  not call fileUploadListeneres, but the component show "DONE"

      upload.jpg

       

      xhtml

       

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich">
      
      
                    <h:form id="form">
                       <rich:fileUpload fileUploadListener="#{java.listenerupload}" 
                               immediateUpload="true" maxFilesQuantity="1000" 
                               listHeight="50px" listWidth="300px" 
                               allowFlash="true" 
                               id="javaupload" >
                        </rich:fileUpload>
                   </h:form>
      
      
          </ui:composition>
      
      

       

      web.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      
      <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee                          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                <display-name>Operador</display-name>
                <context-param>
                          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                          <param-value>.xhtml</param-value>
                </context-param>
                <context-param>
                          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                          <param-value>server</param-value>
                </context-param>
                <context-param>
                          <param-name>javax.portlet.faces.renderPolicy</param-name>
                          <param-value>NEVER_DELEGATE</param-value>
                </context-param>
                <context-param>
                          <param-name>org.richfaces.SKIN</param-name>
                          <param-value>blueSky</param-value>
                </context-param>
                <context-param>
                          <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                          <param-value>enable</param-value>
                </context-param>
                <context-param>
                          <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
                          <param-value>true</param-value>
                </context-param>
                <filter>
                          <filter-name>richfaces</filter-name>
                          <filter-class>org.ajax4jsf.Filter</filter-class>
                          <init-param>
                                    <param-name>createTempFiles</param-name>
                                    <param-value>false</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>maxRequestSize</param-name>
                                    <param-value>550000000</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Cache Filter - Resource</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.cache.CacheFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-ignore-pattern</param-name>
                                    <param-value>.+/-/.+</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>pattern</param-name>
                                    <param-value>2</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Cache Filter - Resource JSP</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.cache.CacheFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-pattern</param-name>
                                    <param-value>.+/(css|main)\.jsp</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>pattern</param-name>
                                    <param-value>2</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>ETag Filter</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.etag.ETagFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-ignore-pattern</param-name>
                                    <param-value>.+/-/.+</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>ETag Filter - JSP</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.etag.ETagFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-pattern</param-name>
                                    <param-value>.+/(css|main)\.jsp</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>GZip Filter</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.gzip.GZipFilter</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Header Filter</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.header.HeaderFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-ignore-pattern</param-name>
                                    <param-value>.+/-/.+</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>Cache-Control</param-name>
                                    <param-value>max-age=315360000, public</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>Expires</param-name>
                                    <param-value>315360000</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>Vary</param-name>
                                    <param-value>Accept-Encoding</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Header Filter - JSP</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.header.HeaderFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-pattern</param-name>
                                    <param-value>.+/(css|main)\.jsp</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>Cache-Control</param-name>
                                    <param-value>max-age=315360000, public</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>Expires</param-name>
                                    <param-value>315360000</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>Vary</param-name>
                                    <param-value>Accept-Encoding</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Language Filter</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.language.LanguageFilter</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Minifier Filter</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.minifier.MinifierFilter</param-value>
                          </init-param>
                </filter>
                <filter>
                          <filter-name>Minifier Filter - JSP</filter-name>
                          <filter-class>com.liferay.portal.kernel.servlet.PortalClassLoaderFilter</filter-class>
                          <init-param>
                                    <param-name>filter-class</param-name>
                                    <param-value>com.liferay.portal.servlet.filters.minifier.MinifierFilter</param-value>
                          </init-param>
                          <init-param>
                                    <param-name>url-regex-pattern</param-name>
                                    <param-value>.+/(css|main)\.jsp</param-value>
                          </init-param>
                </filter>
                <filter-mapping>
                          <filter-name>richfaces</filter-name>
                          <servlet-name>Faces Servlet</servlet-name>
                          <dispatcher>REQUEST</dispatcher>
                          <dispatcher>FORWARD</dispatcher>
                          <dispatcher>INCLUDE</dispatcher>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.css</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.gif</url-pattern>
                </filter-mapping>
                <filter-mapping> 
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.html</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.ico</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.jpg</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.js</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter</filter-name>
                          <url-pattern>*.png</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Header Filter - JSP</filter-name>
                          <url-pattern>*.jsp</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.css</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.gif</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.html</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.ico</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.jpg</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.js</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter</filter-name>
                          <url-pattern>*.png</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>ETag Filter - JSP</filter-name>
                          <url-pattern>*.jsp</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Cache Filter - Resource</filter-name>
                          <url-pattern>*.css</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Cache Filter - Resource</filter-name>
                          <url-pattern>*.html</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Cache Filter - Resource</filter-name>
                          <url-pattern>*.js</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Cache Filter - Resource JSP</filter-name>
                          <url-pattern>*.jsp</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>GZip Filter</filter-name>
                          <url-pattern>*.css</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>GZip Filter</filter-name>
                          <url-pattern>*.html</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>GZip Filter</filter-name>
                          <url-pattern>*.js</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>GZip Filter</filter-name>
                          <url-pattern>*.jsp</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Language Filter</filter-name>
                          <url-pattern>*.js</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Minifier Filter</filter-name>
                          <url-pattern>*.css</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Minifier Filter</filter-name>
                          <url-pattern>*.js</url-pattern>
                </filter-mapping>
                <filter-mapping>
                          <filter-name>Minifier Filter - JSP</filter-name>
                          <url-pattern>*.jsp</url-pattern>
                </filter-mapping>
                <listener>
                          <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                </listener>
                <listener>
                          <listener-class>com.liferay.portal.kernel.servlet.SerializableSessionAttributeListener</listener-class>
                </listener>
                <listener>
                          <listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
                </listener>
                <servlet>
                          <servlet-name>Faces Servlet</servlet-name>
                          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                          <load-on-startup>1</load-on-startup>
                </servlet>
                <servlet>
                          <servlet-name>Operador</servlet-name>
                          <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
                          <init-param>
                                    <param-name>portlet-class</param-name>
                                    <param-value>javax.portlet.faces.GenericFacesPortlet</param-value>
                          </init-param>
                          <load-on-startup>0</load-on-startup>
                </servlet>
                <servlet-mapping>
                          <servlet-name>Faces Servlet</servlet-name>
                          <url-pattern>*.xhtml</url-pattern>
                </servlet-mapping>
                <servlet-mapping>
                          <servlet-name>Operador</servlet-name>
                          <url-pattern>/Operador/*</url-pattern>
                </servlet-mapping>
      </web-app>
      
      

       

      I'm using richfaces 3.3.3

      jboss portletbridge 2.1

      jsf 1.2

        • 1. rich:fileUpload not call fileUploadListener
          arturo eduardo cabrera cordoba Newbie

          I have the same problem. I am using richfaces 4.0.0.Final JSF 2.0 and app runs in tomcat.

          my web.xml is this:

           

              <context-param>

                  <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>

                  <param-value>10000000</param-value>

              </context-param>

              <context-param>

                  <param-name>org.richfaces.fileUpload.createTempFiles</param-name>

                  <param-value>true</param-value>

              </context-param>

             

               <context-param>

                    <param-name>javax.faces.PROJECT_STAGE</param-name>

                    <param-value>Development</param-value>

               </context-param>

               <context-param>

                    <param-name>javax.faces.SKIP_COMMENTS</param-name>

                    <param-value>true</param-value>

               </context-param>

           

              <!-- PARA QUE EL JBOSS USE EL MYFACES DEL WAR -->

           

              <context-param>   

                  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                  <param-value>.jspx</param-value>

              </context-param>

           

              <context-param>

                  <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>

                  <param-value>*.jspx</param-value>

              </context-param>

              

              <context-param>

                    <param-name>org.richfaces.skin</param-name>

                    <param-value>ruby</param-value>

              </context-param>

             

              <context-param>

                    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

                    <param-value>server</param-value>

              </context-param>

              <context-param>

                    <param-name>facelets.DEVELOPMENT</param-name>

                    <param-value>true</param-value>

               </context-param>

              <!-- PARA QUE EL JBOSS USE EL MYFACES DEL WAR -->

           

              <context-param>

                  <param-name>javax.faces.application.CONFIG_FILES</param-name>

                  <param-value>/WEB-INF/faces-config.xml</param-value>

              </context-param>

           

              <!-- Fin de la carga -->

             

              <!-- Carga de componentes del contexto del aplicativo -->

              <context-param>

                  <param-name>contextConfigLocation</param-name>

                  <param-value>

                      classpath:/ar/gob/applicationContext.xml           

                  </param-value>

           

              </context-param>

              <!--

              <context-param>

                  <description>

                      La pagina de error HTTP 500 sea customizada y no la de default

                    </description>

                  <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>

                  <param-value>true</param-value>

              </context-param>

               -->

              <!-- Listener que tiene que estar para que funcione spring -->

              <listener>

                  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

              </listener>

              <!-- Listener que tiene que estar para que funcione spring-security -->

              <listener>

                <listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>                    

              </listener>

           

          <!-- IntrospectorCleanupListener -->

              <listener>

                  <listener-class>

                      org.springframework.web.util.IntrospectorCleanupListener</listener-class>

              </listener>

             

             

              <listener>

                  <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

              </listener>

           

              <listener>

                  <listener-class>

                      org.springframework.web.context.request.RequestContextListener</listener-class>

              </listener>

              <!-- Filtros-->

             

              <!-- Filtro encoding. Define la codificación de caracteres en la que se representarán las páginas -->

             

              <!-- Filtro de spring-security, determina o define la seguridad del aplicativo  -->

              <filter>

                  <filter-name>Spring security Filter Chain Proxy</filter-name>

                  <filter-class>org.springframework.security.util.FilterToBeanProxy</filter-class>

                 

                  <init-param>

                      <param-name>targetBean</param-name>

                      <param-value>filterChainProxy</param-value>

                  </init-param>

              </filter>

           

              <!-- Filtro de hibernate.  -->

           

           

              <!-- Filtros de JSF -->

              

              <!--

             

                  -->

               

              

               <filter-mapping>

                 <filter-name>Spring security Filter Chain Proxy</filter-name>

                 <url-pattern>*.jsf</url-pattern>

                 <dispatcher>FORWARD</dispatcher>

                 <dispatcher>REQUEST</dispatcher>

             </filter-mapping>

            

             <filter-mapping>

                 <filter-name>Spring security Filter Chain Proxy</filter-name>

                 <url-pattern>*.jspx</url-pattern>

                 <dispatcher>FORWARD</dispatcher>

                 <dispatcher>REQUEST</dispatcher>

             </filter-mapping>

            

             

              <!-- Servlet de JSF -->

              <servlet>

                  <servlet-name>Faces Servlet</servlet-name>

                  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                  <load-on-startup>1</load-on-startup>

              </servlet>

             

             

              <!-- Mapping -->

              <servlet-mapping>

                  <servlet-name>Faces Servlet</servlet-name>

                  <url-pattern>*.jsf</url-pattern>

              </servlet-mapping>   

           

          the jspx is this:

           

          <ui:composition template="/includes/template.jspx"

              xmlns:ui="http://java.sun.com/jsf/facelets"

              xmlns:f="http://java.sun.com/jsf/core"

              xmlns:h="http://java.sun.com/jsf/html"

              xmlns:c="http://java.sun.com/jstl/core"

              xmlns:a4j="http://richfaces.org/a4j"

              xmlns:rich="http://richfaces.org/rich"

             

              >

              <style type="text/css">

          .pic-normal {

              width: 120px;

              border: 2px solid #ACBECE;

          }

           

          .wrap1 {

              width: 190px;

              height: 130px;

              float: left;

          }

          </style>

           

              <ui:define name="title">

                .:: Digitalizar Documento ::.

              </ui:define>

           

              <ui:define name="body">

                  <f:loadBundle

                      basename="ar.gob.properties.messages"

                      var="msgs" />

           

                  <div class="Titles"><h:outputText

                      value="#{msgs.tituloDigitalizarDocumento}" /></div>

           

                      <h:form id="formularioUpload">

                      <a4j:outputPanel id="datosSolicitante">

                      <h:panelGrid columns="2">

                                  <h:outputLabel value="#{digitalizarDocumentoBean.contentType}"></h:outputLabel>

                                  <rich:fileUpload id="fileUploadId2"

                                              fileUploadListener="#{digitalizarDocumentoBean.upLoad}"                           

                                              acceptedTypes="jpg, gif, png, bmp"

                                  >

                                  <a4j:ajax event="uploadcomplete" render="infoFile" />

                                  </rich:fileUpload>

                                 

                                   <rich:panel id="infoFile">

                                   <h:outputLabel value="Hola"></h:outputLabel>

                                   </rich:panel>

                       </h:panelGrid>

                      </a4j:outputPanel>       

                      </h:form>                   

                      <a4j:log />

              </ui:define>

          </ui:composition>