4 Replies Latest reply on Feb 4, 2008 7:02 AM by gregtk

    Changing Ajax4jsf-filter url-pattern in JBoss Seam 2.0GA

    gregtk

      Hello! Today I tried change url-pattern for Ajax4jsf-filter. In user guide it looks like that

      <web:ajax4jsf-filter force-parser="true"
      enable-cache="true"
      log4j-init-file="custom-log4j.xml"
      url-pattern="*.seam"/>
      When I tried use it in my project I get trouble in all of my pages with richfaces JSF components they lost skin and functionality. How to resolve that problem? Which url-pattern I must write If my users see pages with .htm suffix. I think I must write like that
      <web:ajax4jsf-filter force-parser="true"
      enable-cache="true"
      log4j-init-file="custom-log4j.xml"
      url-pattern="*.htm"/>
      But It doesn't work.

        • 1. Re: Changing Ajax4jsf-filter url-pattern in JBoss Seam 2.0GA
          pmuir

          You should change the pattern for the JSF servlet. The Ajax4jsf filter mapping is, by default, mapped to all requests.

          • 2. Re: Changing Ajax4jsf-filter url-pattern in JBoss Seam 2.0GA
            gregtk

            I can't find what I need change in web.xml

            <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>*.htm</url-pattern>
             </servlet-mapping>
            - I tried that part. But Ajax4Jsf-filter not only use on ".htm" pattern. It works for my download servlet which have url like /app/servlets/download?fileId=45&ticket=6768876 and try parse OutputSream of binary file. Can you explain how to disable Ajax4jsf-filter for my DownloadServlet only?

            • 3. Re: Changing Ajax4jsf-filter url-pattern in JBoss Seam 2.0GA
              pmuir

              In that case, yes, you need to use a url-pattern on the ajax4jsf filter.

              • 4. Re: Changing Ajax4jsf-filter url-pattern in JBoss Seam 2.0GA
                gregtk

                Ok. I tried in components.xml:

                <web:ajax4jsf-filter force-parser="true"
                enable-cache="true"
                log4j-init-file="custom-log4j.xml"
                url-pattern="*.htm"/>
                


                in web.xml:
                <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>*.htm</url-pattern>
                 </servlet-mapping>


                With that When I start my application from url:"http://localhost:8080/app/admin.htm" I lost skins and fuctionality of RichFaces JSF components. When I exclude
                <web:ajax4jsf-filter force-parser="true"
                enable-cache="true"
                log4j-init-file="custom-log4j.xml"
                url-pattern="*.htm"/>
                
                from components.xml everything is fine. Any ideas? How to resolve this problem?

                Thank you for reply. :)