2 Replies Latest reply on Nov 16, 2011 2:46 PM by Mark Paluch

    JSF 2 + Richfaces 4 "RichFaces is not defined"

    wark Newbie

      Hi,

       

      I'm actually developping, for myself, a simple web application just to see "how it works by practice". Actually, I've included Hibernate + Spring and I'm now working on JSF 2 + RichFaces 4 for the presentation layer.

       

      Everything seems working fine... excepted the fact that I don't have the expected rendering during the navigation... First time the application is launched, I've got the expected result (I'm using an ExtendedDataTable), rendering, and so on... but when I come back to the page, I've got "Uncaught ReferenceError : RichFaces is not defined" (in Google Chrome and IE 9).

       

      I'm using Tomcat 7.0 and Netbeans 7.1. Here's the content of my configurations files :

       

      web.xml

       

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app version="3.0" 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_3_0.xsd">

          <context-param>

              <param-name>contextConfigLocation</param-name>

              <param-value>/WEB-INF/applicationContext.xml</param-value>

          </context-param>

          <context-param>

              <param-name>javax.faces.PROJECT_STAGE</param-name>

              <param-value>Development</param-value>

          </context-param>

          <listener>

              <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

          </listener>

          <listener>

              <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>

          </listener>

          <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>

              <url-pattern>*.jsf</url-pattern>

              <url-pattern>/faces/*</url-pattern>

          </servlet-mapping>

          <session-config>

              <session-timeout>

                  30

              </session-timeout>

          </session-config>

          <welcome-file-list>

              <welcome-file>index.xhtml</welcome-file>

          </welcome-file-list>

      </web-app>

       

       

      Here's the content of my faces-config.xml :

       

       

      <?xml version='1.0' encoding='UTF-8'?>

       

       

      <!-- =========== FULL CONFIGURATION FILE ================================== -->

       

       

      <faces-config version="2.0"

          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_2_0.xsd">

          <application>

              <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>

          </application>

          <navigation-rule>

              <from-view-id>*</from-view-id>

              <navigation-case>

                      <from-outcome>detail</from-outcome>

                      <to-view-id>persondetails.jsf</to-view-id>

              </navigation-case>

              <navigation-case>

                      <from-outcome>list</from-outcome>

                      <to-view-id>personlist.jsf</to-view-id>

              </navigation-case>

          </navigation-rule>

      </faces-config>

       

       

      My XHTML files are in attachment. When I go to personlist.xhtml, the first time, I've the expected redering... when I select one person, I click on details, I see the details of the person... Once I click on "Retour", RichFaces isn't injected inside the ressource. Any help is really welcome, sorry for the beginner question.

       

      Wark