4 Replies Latest reply on Jan 1, 2011 9:13 AM by S K

    richfaces 4 example without seam

    S K Newbie

      Hi,

       

      Nowadays, I am working on migrating jsf 1.2 to jsf 2.0 and together with richfaces.4.0. My application was working correctly with jsf2.0, richfaces-3.3.3.

       

      While migrating to richfaces 4.0 by including below jar files in lib folder

       

      richfaces-components-api-4.0.0.20101110-M4.jar
      richfaces-components-ui-4.0.0.20101110-M4.jar
      richfaces-core-api-4.0.0.20101110-M4.jar
      richfaces-core-impl-4.0.0.20101110-M4.jar

       

      with org.ajax4jsf.Filter set on web.xml I got an exception that there is no such Filter class, yes its not there in the richfaces 4.0.

       

      But, if I remove the Filter then no pages are rendering just a blank page is shown. In my current project I don't use seam filter so I can't use that. I don't have maven setup on my machine which is also blocking me running sample program. I do use VDL tags in my project.

       

      Is there any tutorials or documents available for setting up richfaces4.0 project?? That would be greatful.

      Do we need to have any special settings in faces-config.xml file or web.xml file? Any samples would also be helpful for me.

       

      Thanks in advance

       

      Regards,

      SK

        • 1. Re: richfaces 4 example without seam
          Ilya Sorokoumov Master

          You can download the latest version of RF 4.0 showcase and look into its web.xml and faces-config.xml.

          URL: http://jboss.org/richfaces/download/nightly

          • 2. Re: richfaces 4 example without seam
            Nick Belaevski Master

            Hi,

             

            No special settings (except a4j:push component that requires additional setup). For RF 4 & JSF 2.0 there is no need to use Facelets 1.x and disable built-in JSF view handler - so this should be changed during migration.

            • 3. Re: richfaces 4 example without seam
              S K Newbie

              Hi Nick,

              Thanks for the answer!!

              I actually tried the same way as its described in the richfaces-showcase project's web.xml and faces-config.xml file. Here, only jsf tag was working but the richfaces are not working. It thrown the below expception while trying to load pages with richfaces tag on it,

               

              dropDownPage.xhtml @12,15 <rich:toolBar> Tag Library supports namespace:  http://richfaces.org/rich, but no tag was defined for name: toolBar

               

              As you mentioned, I did the below changes in the faces-config.xml file but with this change the no pages were shown instead the blank page was displayed.

                   <context-param>
                      <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
                      <param-value>true</param-value>
                  </context-param>

               

               

              I faced similar issue with richfaces3.3.3 but that was  resolved after disabling built-in facelet but in richfaces3.3.3 we had  org.ajax4jsf.Filter this helped in rendering page and was loaded correctly.

               

               

              My environment settings are as follows,

              JBoss AS 6

              Richfaces 4.0

               

              Included jars are,

              commons-beanutils.jar
              commons-collections.jar
              commons-digester.jar
              commons-logging.jar
              jstl-1.2.jar
              richfaces-components-api-4.0.0.20101110-M4.jar
              richfaces-components-ui-4.0.0.20101110-M4.jar
              richfaces-core-api-4.0.0.20101110-M4.jar
              richfaces-core-impl-4.0.0.20101110-M4.jar

               

              faces-config.xml file content is,

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

               

              <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
                            version="2.0">

               

                  <application>
                      <!-- system-event-listener>
                          <system-event-listener-class>org.richfaces.resource.MapBasedResourceCodecListener</system-event-listener-class>
                          <system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
                      </system-event-listener -->
                  </application>

               

                  <managed-bean>
                      <managed-bean-name>loginBean</managed-bean-name>
                      <managed-bean-class>com.tutorial.LoginBean</managed-bean-class>
                      <managed-bean-scope>session</managed-bean-scope>
                  </managed-bean>
                 
                  <navigation-rule>
                      <display-name>login.xhtml</display-name>
                      <from-view-id>/login.xhtml</from-view-id>
                      <navigation-case>
                          <from-outcome>login</from-outcome>
                          <to-view-id>/welcome.xhtml</to-view-id>
                      </navigation-case>
                  </navigation-rule>
                 
              </faces-config>

               

               

               

              web.xml file as follows,

               

              <?xml version="1.0" encoding="UTF-8"?>
              <web-app id="richfaces-showcase" 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">
              <display-name>richfaces-showcase</display-name>

                   <context-param>
                      <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
                      <param-value>true</param-value>
                  </context-param>

              <context-param>
                <param-name>org.richfaces.enableControlSkinning</param-name>
                <param-value>true</param-value>
              </context-param>
              <context-param>
                <param-name>org.richfaces.enableControlSkinningClasses</param-name>
                <param-value>false</param-value>
              </context-param>
              <context-param>
                <param-name>org.richfaces.skin</param-name>
                <param-value>#{skinBean.skin}</param-value>
              </context-param>
              <context-param>
                <param-name>javax.faces.PROJECT_STAGE</param-name>
                <param-value>Development</param-value>
              </context-param>
              <context-param>
                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                <param-value>server</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>*.jsf</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>/faces/*</url-pattern>
              </servlet-mapping>
              <mime-mapping>
                <extension>ecss</extension>
                <mime-type>text/css</mime-type>
              </mime-mapping>
              <welcome-file-list>
                <welcome-file>index.html</welcome-file>
                <welcome-file>index.htm</welcome-file>
                <welcome-file>index.jsp</welcome-file>
                <welcome-file>default.html</welcome-file>
                <welcome-file>default.htm</welcome-file>
                <welcome-file>default.jsp</welcome-file>
              </welcome-file-list>
              <login-config>
                <auth-method>BASIC</auth-method>
              </login-config>
              </web-app>

               

              Please let me know if something is wrong on this.

               

              Regards,

              SK

              • 4. Re: richfaces 4 example without seam
                S K Newbie

                I found the problem, thats the tags rich:toolBar and rich:toolBarGroup are renamed as rich:toolbar and rich:toolbarGroup