0 Replies Latest reply on Jan 16, 2009 11:48 AM by Vikash srivastava

    Integration issues (JBossSeam + JSF + Trinidad)

    Vikash srivastava Newbie

      Hi 
      I am trying to integrate JBoss Seam with JSF aand Trinidad. In doing this I followed the suggestions from here: 
      http://wiki.apache.org/myfaces/Facelets_with_Trinidad
      
      Version detail that i am using in project
      1. jboss-seam-2.0.2.
      2. JSF 3.3
      3. trinidad-1.2.10
      
      
      I have added the trinidad-api.jar trinidad-impl.jar in by project bin folder as well as in JBoss library. Also added the JSF control and trinidad control on the same .xhtml page with their namespace. Sample for xhtml page is given below
      
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <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:rich="http://richfaces.org/rich"
               xmlns:tr="http://myfaces.apache.org/trinidad"
              template="layout/app_maintemplate.xhtml">
      
              <ui:define name="body">
                      <h:form id="login">
      <rich:panel>                                                                                                                                                                  
       <s:link value="New User" view="/app_reguser_rv.xhtml">
        <f:param name="mctUserUsrSqlidentity"/>
       </s:link>
      </rich:panel>
      <tr:panelButtonBar>                                          
        <tr:commandButton text="Cancel" immediate="true"/>
      </tr:panelButtonBar>
      </h:form>
              </ui:define>
      </ui:composition>
      
      Now  when i am trying to run the applicationan exception cought "org.apache.myfaces.trinidad.component.UIXComponentBase _getRendererImpl" and the page displayed only the seam and JSF control.
      To solve this issue, i put a renderkit in faces-config.xml and remove the ViewHanlder part,then page cought an exception.
      
      In other case if i am using trinidad component in one page and jsf component on another page and remove the renderkit and insert the view handler in faces-config.xml .Now if i am trying to run the jsf page then it view the jsf control but when i am open the page that contains the trinidad control then it shows a blank page with exception cought at log file.
      but if i remove the view handler and insert the renderkit information in faces-config.xml and run the page which contains the jsf controls, then it cought an exception, as there is no view handler mention. but the page that contains only trinidad controls shows the control on page with some exception on log.
      
      I know that the viewhandler must be in the web.xml. But as per suggession given by Trinidad help,if I remove the viewhandler from the faces-config then the links won't be rendered anymore. This means, if you click on a link nothing happens. If I leave the handler in the faces-config then it works.
      Next problem I can't put te application view handler into the web.xml,because then the web.xml tells me: you can't put an application into the web.xml file.
      So I put the the application view handler into the <context-param> faces-config.xml sample is given below
      
      <application>
          <!-- Use the Trinidad RenderKit -->
           <!--<view-handler>com.sun.facelets.FaceletViewHandler</view-handler> -->
         <default-render-kit-id>
            org.apache.myfaces.trinidad.core
          </default-render-kit-id>
      </application>
      
      "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/webapp_
      2_5.xsd"
      version="2.5">
        <!-- Ajax4jsf -->
        <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.SeamResourceServlet</servlet-class>
        </servlet>
        <servlet-mapping>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <url-pattern>/seam/resource/*</url-pattern>
        </servlet-mapping>
        <!-- Facelets -->
        <context-param>
          <param-name>facelets.DEVELOPMENT</param-name>
          <param-value>true</param-value>
        </context-param>
        <!-- JSF -->
        <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>*.xhtml</url-pattern>
        </servlet-mapping>
        <context-param>
          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
          <param-value>server</param-value>
        </context-param>
        <!-- Trinidad - as suggested by a4j-trinidad example-->
        <context-param>
          <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
          <param-value>com.sun.facelets.FaceletViewHandler</param-value>
        </context-param>
        <filter>
          <filter-name>Trinidad</filter-name>
          <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
        </filter>
        <filter-mapping>
          <filter-name>Trinidad</filter-name>
          <url-pattern>*.xhtml</url-pattern>
          <dispatcher>REQUEST</dispatcher>
          <dispatcher>FORWARD</dispatcher>
          <dispatcher>INCLUDE</dispatcher>
        </filter-mapping>
        <context-param>
          <param-name>org.apache.myfaces.trinidad.CACHE_VIEW_ROOT</param-name>
          <param-value>false</param-value>
        </context-param>
        <servlet>
          <servlet-name>Trinidad Resources</servlet-name>
          <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
        </servlet>
        <servlet-mapping>
          <servlet-name>Trinidad Resources</servlet-name>
          <url-pattern>/adf/*</url-pattern>
        </servlet-mapping>
        <!-- Security -->  
        <!-- Welcome files -->
        <welcome-file-list>
          <welcome-file>index.xhtml</welcome-file>
        </welcome-file-list>
      </web-app>
      "
      
      List of Jar file that i have used 
      
      richfaces-api-3.3.0.BETA1.jar 
      richfaces-ui-3.3.0.BETA1.jar 
      richfaces-impl-3.3.0.BETA1.jar 
      trinidad-api.jar 
      trinidad-impl.jar 
      jsf-facelets.jar 
      jsf-impl.jar 
      jstl-1.2.jar 
      jta1.0.1.jar 
      jsf-api.jar 
      mail-1.4.jar 
      
      I can't understand how to solve this issue.If any one have any idea then please help me.
      also if you have any idea from where I will get some hint or tutorial "how to integrate JBossSeam with JSF and Trinidad" then
      send me the link for details.
      Thanks in advance
      
      vikash