10 Replies Latest reply on Dec 9, 2011 1:29 PM by Vitaliy Pavlov

    HOW TO START WITH RICHFACES 4.x ?!

    motaz emad Newbie

      How to add RichFaces 4.x to projects not based on maven

       

      I read this article but it is not working I need more information plz about how to start with richfaces

       

      how to config web.xml and faces-config.xml and confirm the necessary libs to make richfaces work with tomcat 7 and jsf 2

        • 1. Re: HOW TO START WITH RICHFACES 4.x ?!
          Vitaliy Pavlov Novice

          Hi, motaz emad

           

          When I began, I worked with following configuration:

           

          ------------web.xml--------------

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

          <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"

                   xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"

                   version="3.0">

              <display-name>register</display-name>

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

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

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

          </web-app>

          --------------------------------------

           

          -----------------faces-config.xml----------------

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

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

          </faces-config>

          ---------------------------------------------------------

           

          -----------------lib----------------

              common-annotations.jar

              cssparser-0.9.5.jar

              guava-r09.jar

              jstl.jar

              richfaces-components-api-4.1.0.20110910-M2.jar

              richfaces-components-ui-4.1.0.20110910-M2.jar

              richfaces-core-api-4.1.0.20110910-M2.jar

              richfaces-core-impl-4.1.0.20110910-M2.jar

              sac-1.3.jar

              standard.jar

          ------------------------------------

          • 2. Re: HOW TO START WITH RICHFACES 4.x ?!
            Michael G Novice

            The best way i started with Richfaces 4 was to seach for it along with the keywords example or tutorial.

             

            Here is what i added to my pom.xml to pull in the dependecies in maven.

             

            <properties>

                    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

                    <org.richfaces.version>4.1.0.20111014-M3</org.richfaces.version>

             

                </properties>

             

            <dependencyManagement>

                    <dependencies>

                        <dependency>

                            <groupId>org.richfaces</groupId>

                            <artifactId>richfaces-bom</artifactId>

                            <version>${org.richfaces.version}</version>

                            <scope>import</scope>

                            <type>pom</type>

                        </dependency>

                    </dependencies>

                </dependencyManagement>

             

            <dependency>

                        <groupId>org.richfaces.ui</groupId>

                        <artifactId>richfaces-components-ui</artifactId>

                    </dependency>

                    <dependency>

                        <groupId>org.richfaces.core</groupId>

                        <artifactId>richfaces-core-impl</artifactId>

                    </dependency>

                    <dependency>

                        <groupId>org.jboss.javax.faces</groupId>

                        <artifactId>jboss-jsf-api_2.0_spec</artifactId>

                        <version>2.0</version>

                    </dependency>

                    <dependency>

                        <groupId>org.jboss.javax.validation</groupId>

                        <artifactId>jboss-jsf-api_validation</artifactId>

                        <version>2.0</version>

                    </dependency>

                    <dependency>

                        <groupId>javax.el</groupId>

                        <artifactId>el-api</artifactId>

                        <version>2.2</version>

                    </dependency>

                    <dependency>

                        <groupId>javax.servlet</groupId>

                        <artifactId>servlet-api</artifactId>

                    </dependency>

                    <dependency>

                        <groupId>org.richfaces.cdk</groupId>

                        <artifactId>annotations</artifactId>

                        <scope>provided</scope>

                        <version>${org.richfaces.version}</version>

                    </dependency>

             

            As for the faces-config.xml and web.xml, i didn't touch those yet, i defined the managed beans using annotations.

            I would make sure you use the jboss tools for eclipse which helps when editing the config files.

            • 3. Re: HOW TO START WITH RICHFACES 4.x ?!
              motaz emad Newbie

              it still not working
              I don't know what to do
              richfaces 3.x is working good
              but when I update libs to richfaces 4.x or create new app doesn't work

              • 4. Re: HOW TO START WITH RICHFACES 4.x ?!
                motaz emad Newbie

                I don't know how what is maven, I didn't try to use it, how to build webb app using richfaces without maven ?

                • 5. Re: HOW TO START WITH RICHFACES 4.x ?!
                  Vitaliy Pavlov Novice

                  I may send for You source code for example by e-mail

                  • 6. Re: HOW TO START WITH RICHFACES 4.x ?!
                    jlpktnst Newbie

                    Well, for myself, I just installed eclipse + glassfish plugin, set up the glassfish install and the plugin. Then I made a project with JSF 2 facet and installed mojarra jsf when prompted.

                     

                    After that I just dropped the required libs in WEB-INF/lib folder and all worked.

                    • 7. Re: HOW TO START WITH RICHFACES 4.x ?!
                      motaz emad Newbie

                      WELL, WOW it works finally on glassfish
                      but on tomcat 7 it still doesn't work
                      so I will deploy on glassfish
                      and finally happily I can start development
                      thanks very mush

                      • 8. Re: HOW TO START WITH RICHFACES 4.x ?!
                        motaz emad Newbie

                        @ Vitaliy Pavlov  if you would like to send an example to me jsut to try why is not woking on tomcat 7 I will be grateful

                        • 9. Re: HOW TO START WITH RICHFACES 4.x ?!
                          Vitaliy Pavlov Novice

                          I have sent to Your e-mail.

                           

                           

                          Regards,

                           

                          Vitaliy

                          • 10. Re: HOW TO START WITH RICHFACES 4.x ?!
                            Phuong MaiAnh Newbie

                            Dear Vitaliy Pavlov,

                            Can you send me that example and src code, plz?

                            I has problem with project JSF 2.0 and RichFaces 4.x.

                            Thanks a lot!

                             

                            @ My email : anhphuong190190@yahoo.com