5 Replies Latest reply on Jul 22, 2007 7:40 AM by alexg79

    facelets and seam2

    kgoedert

      Hi,

      I have an working application using facelets + seam 1.2 + jboss 4.0.5.
      Now I´m trying migrate to seam 2 and jboss 4.2.
      My pages using facelets are not being rendered correctly, and no exception or error is shown. What can be wrong?

      web.xml
      --------
      <web-app>
      sig

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</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.LIBRARIES</param-name>
      <param-value>
      /WEB-INF/conf/myComponents.taglib.xml
      </param-value>
      </context-param>

      <filter-name>Seam Filter</filter-name>
      <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>


      <filter-mapping>
      <filter-name>Seam Filter</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>


      <listener-class>
      org.jboss.seam.servlet.SeamListener
      </listener-class>


      <!-- JSF -->


      <listener-class>
      com.sun.faces.config.ConfigureListener
      </listener-class>


      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>


      <servlet-name>Seam Resource Servlet</servlet-name>
      <servlet-class>
      org.jboss.seam.servlet.ResourceServlet
      </servlet-class>



      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.sig</url-pattern>
      </servlet-mapping>

      <servlet-mapping>
      <servlet-name>Seam Resource Servlet</servlet-name>
      <url-pattern>/seam/resource/*</url-pattern>
      </servlet-mapping>
      <session-config>
      <session-timeout>10</session-timeout>
      </session-config>
      <login-config>
      <auth-method>BASIC</auth-method>
      </login-config>

      </web-app>

      My faces-config
      ------------------
      <faces-config>

      <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>

      </faces-config>

      And my components.xml

      <components xmlns="http://jboss.com/products/seam/components"
      xmlns:core="http://jboss.com/products/seam/core"
      xmlns:bpm="http://jboss.com/products/seam/bpm"
      xmlns:web="http://jboss.com/products/seam/web"
      xmlns:persistence="http://jboss.com/products/seam/persistence"
      xmlns:security="http://jboss.com/products/seam/security"
      xmlns:drools="http://jboss.com/products/seam/drools"
      xmlns:framework="http://jboss.com/products/seam/framework"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
      http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
      http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
      http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
      http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
      http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
      http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">

      <core:init jndi-pattern="sig/#{ejbName}/local" />
      <bpm:jbpm>
      <bpm:process-definitions>
      ticketProcess.jpdl.xml
      </bpm:process-definitions>
      <bpm:process-definitions>
      request/request.jpdl.xml
      </bpm:process-definitions>
      </bpm:jbpm>
      <drools:rule-base name="securityRules">
      <drools:rule-files>
      /security.drl
      </drools:rule-files>
      </drools:rule-base>
      <drools:managed-working-memory name="workingMemory"
      rule-base="#{ruleBase}" />
      <security:identity
      authenticate-method="#{authenticator.authenticate}" />


      true

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



      Thanks for any help

        • 1. Re: facelets and seam2
          alexg79

          What's the Content-Type header returned by the server for your Seam pages?

          • 2. Re: facelets and seam2
            kgoedert

            I never configured the content-type. Where should it be configured?

            • 3. Re: facelets and seam2
              kgoedert

              The only things being rendered are pure html tags.
              Tags like ui:composition are not being interpreted by the browser.
              I copied the web.xml and components.xml from the dvd store example, but nothing helped.

              Appreciate any help

              • 4. Re: facelets and seam2
                stu2

                I'd use seam-gen to create a blank new project, then carefully compare your config files with those in the new project. This will always work, as seam-gen is generally quickly updated to reflect seam changes (and has helped me several times).

                • 5. Re: facelets and seam2
                  alexg79

                  I never configured the content-type. Where should it be configured?

                  In my template I use

                  <f:view contentType="text/html">
                  ...
                  </f:view>
                  

                  Because otherwise the content-type is set to application/xhtml+xml, which causes some javascript to not function, and sets the background color to white, regardless of what I defined in CSS. Whoever decided to set the default content type that way deserves a good whipping.