1 2 3 Previous Next 38 Replies Latest reply on Jan 4, 2013 7:37 AM by amitdattha Go to original post
      • 15. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
        nt2005

        One Question: How to use the patch?

        • 16. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
          kartelusm

          I just did the ad-hock method - made a package org.ajax4jsf.webapp in my project and copied the source of the WebXml.java there. Then I applied the patch there and it works. There probably is a more elegant solution, but this is a new bug on an old project that by (un)lucky coincidence I was fixing some small glitches on, so I just didn't want to bother.

          • 17. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
            laurentg

            I fixed the problem using a Servlet Filter. It avoids to have to patch an external library.

            import java.io.IOException;
            import java.io.UnsupportedEncodingException;
            import java.net.URLDecoder;
            
            import javax.servlet.Filter;
            import javax.servlet.FilterChain;
            import javax.servlet.FilterConfig;
            import javax.servlet.ServletException;
            import javax.servlet.ServletRequest;
            import javax.servlet.ServletResponse;
            import javax.servlet.http.HttpServletRequest;
            import javax.servlet.http.HttpServletRequestWrapper;
            
            public class RichFacesFirefox11Filter implements Filter {
            
                @Override
                public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
                    chain.doFilter(new HttpServletRequestWrapper((HttpServletRequest) request) {
                        @Override
                        public String getRequestURI() {
                            try {
                                return URLDecoder.decode(super.getRequestURI(), "UTF-8");
                            } catch (UnsupportedEncodingException e) {
                                throw new IllegalStateException("Cannot decode request URI.", e);
                            }
                        }
                    }, response);
                }
            
                @Override
                public void init(FilterConfig filterConfig) throws ServletException {
                    // do nothing
                }
            
                @Override
                public void destroy() {
                    // do nothing
                }
            
            }
            

            The filter is in web.xml configured :

                    <filter>
                      <filter-name>RichFacesFirefox11Filter</filter-name>
                      <filter-class>my.package.RichFacesFirefox11Filter</filter-class>
                 </filter>
                 <filter-mapping>
                      <filter-name>RichFacesFirefox11Filter</filter-name>
                      <url-pattern>/a4j/*</url-pattern>
                 </filter-mapping>
            
            • 18. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
              hoschi0815

              Awesome!

              As I detected that the rich:tree component is affected as well I applied the RichFacesFirefox11Filter *rrooaarrr* to my application and It's working quite well!

              Great job and that simple and effective! No need to apply a patch!

               

              • 19. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                marti63

                THX

                Works for rich:tab as well.

                • 20. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                  trepik

                  Hi, I applied your code, but I have still same problem like before. Can there be problem in that I'm using Richfaces 3.3.2 ? I'm using that because I have to use JSF 1.2... Have someone any advise? Thanks

                  • 21. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                    hoschi0815

                    Jan Plas schrieb:

                     

                    Hi, I applied your code, but I have still same problem like before. Can there be problem in that I'm using Richfaces 3.3.2 ? I'm using that because I have to use JSF 1.2... Have someone any advise? Thanks

                    Hi Jan Plas,

                    we're using JSF 1.2 as well.

                    But we're using Richfaces 3.3.3.Final and the RichFacesFirefox11Filter is working quite well!

                    I propose to upgrade to 3.3.3.Final!

                    Perhaps it works!

                    • 22. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                      trepik

                      OK, I'll try and I'll tell you. Thx

                      • 23. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                        trepik

                        EDIT: Problem is only always after I try rerender PickList.

                        ----------------------------------------------------------------------------------

                        OK, so, right now I can run my project... I changed RF from 3.3.2.SR1 to 3.3.3.Final, added following dependencies but I have still error

                         

                        SEVERE: Servlet.service() for servlet Spring MVC Dispatcher Servlet threw exception
                        javax.faces.FacesException: Error decode resource data
                            at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:627)
                            at org.ajax4jsf.resource.ResourceBuilderImpl.getResourceDataForKey(ResourceBuilderImpl.java:371)
                            at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:156)
                            at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
                            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:508)
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                            at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:143)
                            ...
                        Caused by: java.util.zip.DataFormatException: incorrect data check
                            at java.util.zip.Inflater.inflateBytes(Native Method)
                            at java.util.zip.Inflater.inflate(Inflater.java:256)
                            at java.util.zip.Inflater.inflate(Inflater.java:274)
                            at org.ajax4jsf.resource.ResourceBuilderImpl.decrypt(ResourceBuilderImpl.java:621)
                            ... 26 more
                        
                        

                         

                        Any idea?

                         

                        Inserted dependencies:

                         

                          <dependency>
                                    <groupId>org.richfaces.framework</groupId>
                                    <artifactId>richfaces-impl</artifactId>
                                    <version>3.3.3.Final</version>
                                </dependency>
                        
                                <dependency>
                                    <groupId>org.richfaces.framework</groupId>
                                    <artifactId>richfaces-api</artifactId>
                                    <version>3.3.3.Final</version>
                                </dependency>
                        
                        
                               <dependency>
                                    <groupId>commons-digester</groupId>
                                    <artifactId>commons-digester</artifactId>
                                    <version>1.7</version>
                                </dependency>
                        
                        • 24. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                          hoschi0815

                          Hmm,

                          can you please post you're web.xml settings and set a breakpoint in your RichFacesFirefox11Filter and double check whether the filter is evaluated by your webcontainer and the code stops in it.

                          Otherwise the filter is not processed!

                          • 25. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                            trepik

                            web.xml

                             

                            <?xml version="1.0" encoding="UTF-8"?>
                            <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               
                                <context-param>
                                   ...
                                </context-param>
                                <filter>
                                    <display-name>RichFaces Filter</display-name>
                                    <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>41943040</param-value>
                                    </init-param>
                                </filter>
                                <filter>
                                    <filter-name>encodingFilter</filter-name>
                                    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
                                    <init-param>
                                        <param-name>encoding</param-name>
                                        <param-value>UTF-8</param-value>
                                    </init-param>
                                    <init-param>
                                        <param-name>forceEncoding</param-name>
                                        <param-value>true</param-value>
                                    </init-param>
                                </filter>
                                <filter-mapping>
                                    <filter-name>encodingFilter</filter-name>
                                    <url-pattern>/*</url-pattern>
                                </filter-mapping>
                                <filter>
                                    <filter-name>springSecurityFilterChain</filter-name>
                                    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
                                </filter>
                                <filter>
                                      <filter-name>RichFacesFirefox11Filter</filter-name>
                                      <filter-class>my.project.utils.RichFacesFirefox11Filter</filter-class>
                                 </filter>
                                 <filter-mapping>
                                      <filter-name>RichFacesFirefox11Filter</filter-name>
                                      <url-pattern>/a4j/*</url-pattern>
                                 </filter-mapping>
                                <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>richfaces</filter-name>
                                    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                                    <dispatcher>REQUEST</dispatcher>
                                    <dispatcher>FORWARD</dispatcher>
                                    <dispatcher>INCLUDE</dispatcher>
                                </filter-mapping>
                                <filter-mapping>
                                    <filter-name>springSecurityFilterChain</filter-name>
                                    <url-pattern>/*</url-pattern>
                                    <dispatcher>FORWARD</dispatcher>
                                    <dispatcher>REQUEST</dispatcher>
                                </filter-mapping>
                                <listener>
                                    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
                                </listener>
                                <listener>
                                    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
                                </listener>
                                <servlet>     
                                 ...    </servlet>
                                <servlet-mapping>
                                 ...       
                                </servlet-mapping>
                                <session-config>
                                    <session-timeout>20</session-timeout>
                                </session-config>
                                <error-page>
                                    ...
                                </error-page>
                                <security-constraint>
                                   ...
                                </security-constraint>   
                            </web-app>
                            

                             

                             

                            And I added breakpoints into the Filter and nothings happend... How is it possible??? Is there something wrong!?

                            • 26. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                              hoschi0815

                              The web.xml settings are looking good!

                              Did you check your server logs whether the filter is loaded correctly or is actually loaded?

                              For me I placed the mapping directly after the Faces Servlet:


                               

                               

                               

                              <filter-mapping>
                                  <filter-name>ajax4jsf</filter-name>
                                  <servlet-name>Faces Servlet</servlet-name>
                                  <dispatcher>REQUEST</dispatcher>
                                  <dispatcher>FORWARD</dispatcher>
                                  <dispatcher>INCLUDE</dispatcher>
                              </filter-mapping>
                              <filter>
                                  <filter-name>RichFacesFirefox11Filter</filter-name>
                                  <filter-class>de.bwl.iz.fiona.fsv.ui.session.RichFacesFirefox11Filter</filter-class>
                              </filter>
                              <filter-mapping>
                                  <filter-name>RichFacesFirefox11Filter</filter-name>
                                  <url-pattern>/a4j/*</url-pattern>
                              </filter-mapping>
                              
                              • 27. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                                trepik

                                Maybe I search wrong way, but I didn't find any mention about that filter. Where should it be mentioned?

                                • 28. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                                  hoschi0815

                                  It's loaded on startup. Which webcontainer do you use? Tomcat in Eclipse? If you enable remote debugging http://wiki.apache.org/tomcat/FAQ/Developing you can verify whether the filter is loaded or not.

                                  But on the other hand I'm wondering why you use JSF and Spring MVC? Perhaps this confuses you're contexts and the Spring MVC is validating you're context before the other one has the chance to work.

                                  On testing purpose do you have a chance to comment Spring MVC?

                                  But finally if you use JSF with Richfaces there should be no need to use Spring MVC!!

                                  • 29. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
                                    ibstmt

                                    Can someone explain how to apply the patch?