-
15. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
nt2005 Mar 20, 2012 11:34 AM (in response to kartelusm)One Question: How to use the patch?
-
16. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
kartelusm Mar 20, 2012 11:45 AM (in response to nt2005)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 Mar 21, 2012 3:46 AM (in response to 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 Mar 21, 2012 6:32 AM (in response to laurentg)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 Mar 26, 2012 3:18 AM (in response to laurentg)THX
Works for rich:tab as well.
-
20. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
trepik Mar 26, 2012 4:29 AM (in response to laurentg)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 Mar 26, 2012 4:38 AM (in response to trepik)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 Mar 26, 2012 5:12 AM (in response to hoschi0815)OK, I'll try and I'll tell you. Thx
-
23. Re: Firefox 11 and Richfaces 3.3.3 rich:picklist / a4j:outputMedia
trepik Mar 26, 2012 6:51 AM (in response to 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 Mar 26, 2012 7:11 AM (in response to trepik)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 Mar 26, 2012 7:30 AM (in response to hoschi0815)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 Mar 26, 2012 7:44 AM (in response to trepik)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 Mar 26, 2012 7:59 AM (in response to hoschi0815)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 Mar 26, 2012 8:55 AM (in response to trepik)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 Mar 26, 2012 3:52 PM (in response to hoschi0815)Can someone explain how to apply the patch?