6 Replies Latest reply on Jul 15, 2010 5:13 PM by nbelaevski

    netbeans 6.9 + jsf 2.0 + richfaces

    figds

      Hi,

       

      I'm trying to use richfaces into a project i'm developing under netbeans 6.9 + jsf 2.0. Everything works fine but when I add richfaces's libraries, change the configuration files and run the project, instead of loading the index.xhtml page on the browser, it tryies to download it (a dialog with save/cancel options appears). I mean, i can't render the page.

       

      Do you know why?

       

      Thanks in advance.

       

      PS. Forgive my english...

       

      Damián.

        • 1. Re: netbeans 6.9 + jsf 2.0 + richfaces
          nbelaevski

          Hi Damián,

           

          What is version of RichFaces?

          • 2. Re: netbeans 6.9 + jsf 2.0 + richfaces
            figds

            I tried 3.3.3 (and it runs in glassfish v3)

             

            This is what I do.

            I start a new project from the netbeans' wizard and select JSF 2.0. When I run the project, it shows the common hello world message in the index.xhtml page. Then, I add the libraries and configuration files to use richfaces. I re-run the project and this time the page doesn't load, it just gives me the option to download it...  If I change the extension to jsp (index.jsp), everything works fine.

            error jsf.png

             

            Tks for your answer.

            • 3. Re: netbeans 6.9 + jsf 2.0 + richfaces
              nbelaevski

              Looks like problem with view handler. Can you please check project configuration according to this document: http://community.jboss.org/wiki/RichFaces333andJSF20?

              • 4. Re: netbeans 6.9 + jsf 2.0 + richfaces
                figds

                I'll check that. Thank you very much for your help!!!

                • 5. Re: netbeans 6.9 + jsf 2.0 + richfaces
                  figds

                  Nick,

                  unfortunately, I tried everything that doc says but it didn't work anyway. I'll try to use version 4.0 but i'd like to know what's happening... I'm reading everything I find but still can't solve my problem.

                   

                  This is my web.xml file:

                   

                  <?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>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
                       <param-value>true</param-value>
                  </context-param>
                  <context-param>
                          <param-name>javax.faces.PROJECT_STAGE</param-name>
                          <param-value>Development</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>/faces/*</url-pattern>
                      </servlet-mapping>
                      <session-config>
                          <session-timeout>
                              30
                          </session-timeout>
                      </session-config>
                      <welcome-file-list>
                          <welcome-file>faces/index.xhtml</welcome-file>
                      </welcome-file-list>
                     
                      <!-- RICHFACES -->

                      <!-- Plugging the "Blue Sky" skin into the project -->
                  <context-param>
                     <param-name>org.richfaces.SKIN</param-name>
                     <param-value>blueSky</param-value>
                  </context-param>

                  <!-- Making the RichFaces skin spread to standard HTML controls -->
                  <context-param>
                        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                        <param-value>enable</param-value>
                  </context-param>

                  <!-- Defining and mapping the RichFaces filter -->
                  <filter>
                     <display-name>RichFaces Filter</display-name>
                     <filter-name>richfaces</filter-name>
                     <filter-class>org.ajax4jsf.Filter</filter-class>
                  </filter>

                  <filter-mapping>
                     <filter-name>richfaces</filter-name>
                     <servlet-name>Faces Servlet</servlet-name>
                     <dispatcher>REQUEST</dispatcher>
                     <dispatcher>FORWARD</dispatcher>
                     <dispatcher>INCLUDE</dispatcher>
                  </filter-mapping>

                  </web-app>

                   

                   

                   

                  I don´t want to bother you any more, but if you can, please take a look at it and tell me if you find something wrong.

                   

                  This are the librearies I'm using:

                  commons-beanutils-1.7.0.jar

                  commons-collections-3.2.1.jar

                  commons-digester-2.0.jar

                  commons-logging-1.1.1.jar

                  jhighlight-1.0.jar

                  richfaces-api-3.3.3.Final.jar

                  richfaces-impl-jsf2-3.3.3.Final.jar

                  richfaces-ui-3.3.3.Final.jar

                   

                  I really appreciate your help. Thanks!

                   

                  Damián.

                  • 6. Re: netbeans 6.9 + jsf 2.0 + richfaces
                    nbelaevski

                    Damian,

                     

                    RF 3.3.3 requires Facelets 1.x, not the built-in JSF 2.0 Facelets, so the following things should be done:

                     

                    - Facelets 1.1.x added to classpath

                    - com.sun.facelets.FaceletViewHandler configured as view handler in faces-config.xml or in web.xml