4 Replies Latest reply on Sep 18, 2007 2:58 PM by Brian Smith

    Configuring richfaces/ajax4jsf with seam 2.0?

    Daniel Hinojosa Master

      How hard does it have to be to configure richfaces/ajax4jsf with seam 2.0?

      This is nuts now....

      My setup

      In my war file (relevant info only):

       0 Tue Sep 18 12:17:14 MDT 2007 WEB-INF/lib/
       11615 Wed Aug 29 17:40:32 MDT 2007 WEB-INF/lib/jboss-seam-debug.jar
      199089 Wed Aug 29 17:40:26 MDT 2007 WEB-INF/lib/jboss-seam-ui.jar
      300600 Sun Aug 05 12:40:14 MDT 2007 WEB-INF/lib/jsf-facelets.jar
      1146379 Wed Sep 12 17:28:48 MDT 2007 WEB-INF/lib/richfaces-impl-3.1.0.ja
      1498248 Wed Sep 12 17:40:28 MDT 2007 WEB-INF/lib/richfaces-ui-3.1.0.jar
      



      In my ear file (relevant info only):
      112712 Wed Sep 12 17:28:12 MDT 2007 richfaces-api-3.1.0.jar
      


      In my application.xml file (relevant info only):
       .....
       <module>
       <java>richfaces-api-3.1.0.jar</java>
       </module>
       ......
      


      In my web.xml file (relevant info only):
      <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
      
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
      
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
      
       <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>
      
       <servlet>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <servlet-class>org.jboss.seam.servlet.SeamResourceServlet
       </servlet-class>
       </servlet>
      
       <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>Seam Resource Servlet</servlet-name>
       <url-pattern>/seam/resource/*</url-pattern>
       </servlet-mapping>
      
      
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.xhtml</url-pattern>
       </servlet-mapping>
      


      In my components.xml (relevant info only)
      <web:ajax4jsf-filter force-parser="true"
       enable-cache="true"
       log4j-init-file="custom-log4j.xml"
       url-pattern="*.xhtml"/>
      



      I do not set up the filter explicitly in the web.xml because the documentation says so. Now I get 'a4j not defined' in the browser, any help is appreciated. ;)

      Danno

        • 1. Re: Configuring richfaces/ajax4jsf with seam 2.0?
          Brian Smith Apprentice

          You don't need the a4j filter in components.xml

          Here is an example of a properly set up web.xml

          (You are missing the Seam Listener)

          <?xml version="1.0" ?>
          <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
           version="2.4">
          
           <!-- Ajax4jsf -->
          
           <context-param>
           <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
           <param-value>com.sun.facelets.FaceletViewHandler</param-value>
           </context-param>
          
           <context-param>
           <param-name>org.ajax4jsf.SKIN</param-name>
           <param-value>blueSky</param-value>
           </context-param>
          
           <!-- Seam -->
          
           <listener>
           <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
           </listener>
          
           <filter>
           <filter-name>Seam Filter</filter-name>
           <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
           </filter>
          
           <filter-mapping>
           <filter-name>Seam Filter</filter-name>
           <url-pattern>/*</url-pattern>
           </filter-mapping>
          
           <servlet>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
           </servlet>
          
           <servlet-mapping>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
          
           <!-- Facelets development mode (disable in production) -->
          
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <context-param>
           <param-name>facelets.SKIP_COMMENTS</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <!-- JSF -->
          
           <context-param>
           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
           <param-value>client</param-value>
           </context-param>
          
           <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.xhtml</param-value>
           </context-param>
          
           <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>*.seam</url-pattern>
           </servlet-mapping>
          
           <security-constraint>
           <display-name>Restrict raw XHTML Documents</display-name>
           <web-resource-collection>
           <web-resource-name>XHTML</web-resource-name>
           <url-pattern>*.xhtml</url-pattern>
           </web-resource-collection>
           <auth-constraint>
           <role-name>NONE</role-name>
           </auth-constraint>
           </security-constraint>
          
          </web-app>


          Other than that, your packaging looks ok

          • 2. Re: Configuring richfaces/ajax4jsf with seam 2.0?
            Daniel Hinojosa Master

            I did have the listener....Forgot to post it is all, going to try it now

            • 3. Re: Configuring richfaces/ajax4jsf with seam 2.0?
              Daniel Hinojosa Master

              Well goddamn, I feel moist!

              Wait, did I just write that?
              Thanks for the help!

              Danno