4 Replies Latest reply on Nov 28, 2007 3:52 AM by orhan yilmaz

    Help Ajax4jsf 1.1.1, Seam 1.2.1GA Setup

    Terry Apprentice

      Having problem configuring ajax 1.1.1 and richfaces 3.0.1 with seam 1.2.1.

      I have seam-gen generated app with facelets and RHDS beta2 set up, with JBoss 4.2.2.

      When I use something like <a4j ..> or <rich:...> they just get ignored; no error but just not processed. But when I use <a: ... and <f: ...> they work fine.

      I guess I have some issue with setup?

      user-activity-list.xhtml - This does not work
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       template="layout/template.xhtml">
      
      ...
       <h:outputLabel for="action">Activity</h:outputLabel>
       <h:inputText id="action" value="#{userActivityList.userActivity.action}">
       <a4j:support event="onkeyup" reRender="userActivityListResults"/>
       </h:inputText>
      ...
      
      
      user-activity-list.xhtml - This works
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:a="https://ajax4jsf.dev.java.net/ajax"
       template="/layout/template.xhtml">
      ...
       <h:outputLabel for="action">Activity</h:outputLabel>
       <h:inputText id="action" value="#{userActivityList.userActivity.action}">
       <a:support event="onkeyup" reRender="userActivityListResults"/>
       </h:inputText>
      ...
      
      web.xml
      <?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 (must come first!) -->
      
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>
      
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</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.web.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>false</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>
      
       <error-page>
       <exception-type>java.lang.Exception</exception-type>
       <location>/error.jsp</location>
       </error-page>
      
       <error-page>
       <error-code>404</error-code>
       <location>/error-404.seam</location>
       </error-page>
      
       <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/>
       </security-constraint>
      
      </web-app>
      
      faces-config.xml
      <?xml version='1.0' encoding='UTF-8'?>
      <faces-config version="1.2"
       xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
      
       <!-- Seam transaction management -->
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener</phase-listener>
       </lifecycle>
      
       <!-- No Seam transaction management -->
       <!--
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>
       -->
      
       <application>
       <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
       <message-bundle>messages</message-bundle>
      
       <!-- Disabled when using Ajax4JSF -->
       <!--
       <view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
       -->
       </application>
      </faces-config>
      
      web-inf/lib/*.jar
      ajax4jsf-1.1.1-SNAPSHOT.jar
      richfaces-3.0.1-SNAPSHOT.jar