3 Replies Latest reply on May 9, 2011 2:06 PM by denebj

    RF4 - FileUpload issue

    denebj

      Good morning

      I have a question, I am migrating my Richfaces application from 3.3.3 to 4.0.0 Final.
      Everything is working except the rich:fileUpload component.
      It is working if I remove the pretty faces filters.

       

      So I believe I have the filters in a bad order

      The thing is in the RF 3.3.3 the web.xml was like that :

       

      <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
      </filter>

      <filter>
        <display-name>Ajax4jsf Filter</display-name>
        <filter-name>ajax4jsf</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
        <init-param>
         <param-name>createTempFiles</param-name>
         <param-value>true</param-value>
        </init-param>
      </filter>

      <filter>
        <filter-name>Pretty Filter</filter-name>
        <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
      </filter>
      <filter-mapping>

      <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
      </filter-mapping>
      <filter-mapping>

      <filter-name>ajax4jsf</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
      </filter-mapping>
      <filter-mapping>

      <filter-name>Pretty Filter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
      </filter-mapping>

       

       

      But with the RF 4 there is not ajax4jsf anymore, it is integrated into the richfaces libs, so my web.xml is like that :

       

       

        <!-- Enables Spring Security -->
      <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
      </filter>
      <filter-mapping>

      <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
      </filter-mapping>

      <filter>
        <filter-name>Pretty Filter</filter-name>
        <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
      </filter>

      <filter-mapping>
        <filter-name>Pretty Filter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
      </filter-mapping>

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

      <!-- Loads the Spring web application context -->
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
      </listener>
      <listener>
        <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</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-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>

       

       

       

      My config is :
      Apache-Tomcat 6.0.32
      Richfaces 4 Final
      Pretty Faces 3.2.0
      Spring/Spring security 3.0.5

       

       

      Thank you for your help !!!

        • 1. RF4 - FileUpload issue
          denebj

          So, when I try to upload, I found that in the code, is it normal to have this kind of URL ?

           

          May 6, 2011 4:47:56 PM com.ocpsoft.pretty.faces.url.QueryString addParameters

          WARNING: Ignoring invalid query parameter: rf_fu_uid=0.4817337519477827%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2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%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2f%2/

          • 2. RF4 - FileUpload issue
            turocabrera

            Hi, mmmmm

            I had this problem.

            First,  check the security rules of Spring Security.

             

            Rich makes calls to javascript

             

            add this rules for example:

             

            <security:intercept-url pattern="/a4j/*" access="PERMISSION_ANONYMOUS_USER"/>

            <security:intercept-url pattern="/a4j/**" access="PERMISSION_ANONYMOUS_USER"/>

            <security:intercept-url pattern="/rfres/*" access="PERMISSION_ANONYMOUS_USER"/>

            <security:intercept-url pattern="/rfres/**" access="PERMISSION_ANONYMOUS_USER"/>

            <security:intercept-url pattern="/pages/*jsf**" access="PERMISSION_WORKFLOW_USER"/>

             

            seconds, in the web.xml

             

                <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>

            • 3. RF4 - FileUpload issue
              denebj

              Huum , I Thought of that and I already have that in my web.xml :

               

                      <intercept-url pattern="/rfRes/**" filters="none" />

                      <intercept-url pattern="/rfres/**" filters="none" />

               

               

              and in Firebug I can see that looping again and again:

               

              https://localhost:8443/rfRes/fileUploadProgress.jsf?ln=org.richfaces&rf_fu_uid_alt=0.31454627890407716

               

              So no luck :/