PrettyFaces does not coexist with OpenFaces

Splash Forums PrettyFaces Users PrettyFaces does not coexist with OpenFaces

This topic contains 2 replies, has 2 voices, and was last updated by  Lincoln Baxter III 6 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17809

    nicog
    Participant

    Hi,

    First of all: beautiful job guys…

    I struggled couple of days discovering this issue

    I have an application that uses RichFaces 3.3.3.Final and OpenFaces 2.0.Final (+PrimeFaces)

    After adding PrettyFaces all broke..

    I discovered that if I remove OpenFaces filter, all was working fine again.

    There is obbviously a conflict between OpenFaces and PrettyFaces as THEY USE THE SAME FILTER MAPPING

    My web.xml is as follows:

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

    <filter>

    <display-name>RichFaces Filter</display-name>

    <filter-name>RichFacesFilter</filter-name>

    <filter-class>org.ajax4jsf.Filter</filter-class>

    <init-param>

    <param-name>createTempFiles</param-name>

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

    </init-param>

    <init-param>

    <param-name>maxRequestSize</param-name>

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

    </init-param>

    <!– PERFORMANCE OPTIMIZATION–>

    <init-param>

    <param-name>forcenotrf</param-name>

    <param-value>false</param-value>

    </init-param>

    </filter>

    <filter-mapping>

    <filter-name>RichFacesFilter</filter-name>

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

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <!– FILTER FOR PROCESSING INTERNAL OPENFACES RESOURCES –>

    <filter>

    <filter-name>ResourceFilter</filter-name>

    <filter-class>org.openfaces.util.ResourceFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>ResourceFilter</filter-name>

    <url-pattern>/*</url-pattern>

    </filter-mapping>

    Any clue on how to get it fixed

    Many thanks in advance

    #20378

    nicog
    Participant

    Actually found the solution:

    this has something to do with filters order in web.xml

    <!– FILTERS –>

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

    <filter>

    <filter-name>ResourceFilter</filter-name>

    <filter-class>org.openfaces.util.ResourceFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>ResourceFilter</filter-name>

    <url-pattern>/*</url-pattern>

    </filter-mapping>

    <filter>

    <display-name>RichFaces Filter</display-name>

    <filter-name>RichFacesFilter</filter-name>

    <filter-class>org.ajax4jsf.Filter</filter-class>

    <init-param>

    <param-name>createTempFiles</param-name>

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

    </init-param>

    <init-param>

    <param-name>maxRequestSize</param-name>

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

    </init-param>

    <!– PERFORMANCE OPTIMIZATION–>

    <init-param>

    <param-name>forcenotrf</param-name>

    <param-value>false</param-value>

    </init-param>

    </filter>

    <filter-mapping>

    <filter-name>RichFacesFilter</filter-name>

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

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <filter>

    <description>Redirection vers Login.jsp</description>

    <filter-name>SecurityCheckFilter</filter-name>

    <filter-class>com.mfpsoft.security.SecurityCheckFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>SecurityCheckFilter</filter-name>

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

    </filter-mapping>

    #20379

    Awesome! Yes, filter ordering is very important. PrettyFaces should usually come before others. Glad you figured this out.

    –Lincoln

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.