1 Reply Latest reply on Aug 27, 2007 5:15 AM by Alexandru Enache

    SEAM + JSF custom components

    Alexandru Enache Newbie

      Hi everyone,

      I am developing an application that uses SEAM and JSF. I've created some custom JSF components which I will use. The JSF components where tested on JBoss AS and they work as intended. But when I tried to build the application for SEAM, it seems not to work. Maybe it is related to the structure of the .ear.
      I am also using the pageflow from jBPM.

      My structure is the following:

      /app.ear
       /META-INF
       /application.xml
       /jboss-app.xml
       /el-api.jar
       /el-ri.jar
       /jboss-seam.jar
       /jbpm-3.1.4.jar
       /appbeans.jar //which contains seam.properties
       /app.war
       /WEB-INF
       /lib
       /jboss-seam-ui.jar
       /appcomponents.jar //my JSF components
       /*.jspx pages
       /*.jpdl.xml files


      My index.html page contains redirect:
      <html>
      <head>
       <meta http-equiv="Refresh" content="5; URL=test.seam">
      </head>
      <body>
      testing!!!
      </body>
      </html>


      This page actually loads, and displays the "testing!!!" text on the browser. But when the redirect is done, it sais that it does not find the test.seam page.

      Maybe I am doing something wrong, or maybe I need other structure because of the custom components. I've read many online docs that talk about packaging and deploying applications on SEAM. But I could not make mine work. Any help is much appreciated since I really need to make this work.

      Regards,
      Alex

        • 1. Re: SEAM + JSF custom components
          Alexandru Enache Newbie

          For convenience, I will provide additional info:
          JBoss AS 4.0.5
          SEAM 1.2
          JSF 1.1

          I dont have any beans yet, so the beans jar is only present by name, it doesn't have anything to load.

          pageflow.jpdl.xml

          <pageflow-definition
           xmlns="http://jboss.com/products/seam/pageflow"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation=
           "http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
           name="test">
          
           <start-page name="displayTest" view-id="/test.jspx">
           <redirect/>
           <transition name="quit" to="quit"/>
           </start-page>
          
           <page name="quit" view-id="/quit.jspx">
           <redirect/>
           <transition name="yes" to="bye"/>
           </page>
          
           <page name="bye" view-id="/bye.jspx">
           <redirect/>
           <end-conversation/>
           </page>
          </pageflow-definition>


          web.xml
          <?xml version="1.0" encoding="UTF-8"?>
          
          <web-app version="2.5"
           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-app_2_5.xsd">
          
           <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>
          
           <listener>
           <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
           </listener>
          
           <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>.jspx</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>
          
           <session-config>
           <session-timeout>10</session-timeout>
           </session-config>
          
          </web-app>


          pages.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE pages PUBLIC
           "-//JBoss/Seam Pages Configuration DTD 1.1//EN"
           "http://jboss.com/products/seam/pages-1.1.dtd">
          <pages>
           <page view-id="/test.jspx">
           <begin-conversation pageflow="test"/>
           </page>
          </pages>


          faces-config.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE faces-config
          PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
           "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
          
          <faces-config>
          
           <lifecycle>
           <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
           </lifecycle>
          
          </faces-config>


          components.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <components xmlns="http://jboss.com/products/seam/components"
           xmlns:core="http://jboss.com/products/seam/core"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation=
           "http://jboss.com/products/seam/core
           http://jboss.com/products/seam/core-1.1.xsd
           http://jboss.com/products/seam/components
           http://jboss.com/products/seam/components-1.1.xsd">
          
           <component name="org.jboss.seam.core.init">
           <property name="debug">true</property>
           </component>
          
           <component class="org.jboss.seam.core.Jbpm">
           <property name="pageflowDefinitions">
           <value>pageflow.jpdl.xml</value>
           </property>
           </component>
          
           <component class="org.jboss.seam.core.Microcontainer"
           installed="@microcontainer@"/>
          
          </components>


          application.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <application 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/application_5.xsd"
           version="5">
          
           <display-name>Project Manager</display-name>
          
           <module>
           <web>
           <web-uri>projectmanager.war</web-uri>
           <context-root>/projectmanager</context-root>
           </web>
           </module>
           <module>
           <ejb>pmbeans.jar</ejb>
           </module>
           <module>
           <java>jboss-seam.jar</java>
           </module>
           <module>
           <java>jbpm-3.1.4.jar</java>
           </module>
           <module>
           <java>el-api.jar</java>
           </module>
           <module>
           <java>el-ri.jar</java>
           </module>
          
          </application>


          As you can see, the contents of these files resembles very good with the ones from the NumberGuess example.