开发者

RichFaces 3.3.3 with JSF 2.0 working example

开发者 https://www.devze.com 2023-01-12 01:59 出处:网络
I\'m very new to JSF and i\'m looking for a pure configuration of JSF 2.0 with RichFaces 3.3.3.Final. T开发者_运维技巧he documentationon JBoss website is for JSF 1.2. I also find this jboss article bu

I'm very new to JSF and i'm looking for a pure configuration of JSF 2.0 with RichFaces 3.3.3.Final. T开发者_运维技巧he documentation on JBoss website is for JSF 1.2. I also find this jboss article but the sample application has a lot of configurations.

If you have successfully made RichFaces and JSF 2 work, please share you config. Thank you.


You have to add the latest facelets, richfaces 3.3.3 and jsf 2.x libraries. this is my web.xml config i'm using for my project:

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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">

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</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>
    <context-param>
        <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
        <param-value>true</param-value>
    </context-param>

    <!--Configuration for Richfaces-->
    <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>
    <!--End of the configuration part for Richfaces-->

    <!--Configuration for Facelets-->
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.jsp</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.VIEW_MAPPINGS</param-name>
        <param-value>*.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <!--End of the configuration part for Facelets-->


    <welcome-file-list>
        <welcome-file>faces/index.jsp</welcome-file>
    </welcome-file-list>


</web-app>

and this is what you can find on my library: standard.jar (for JSTL)

jstl.jar (for JSTL)

jsf-facelets.jar (Facelets 1. 1. 15)

richfaces-api-3.3.3.Final.jar

richfaces-impl-jsf2-3.3. 3.Final.jar

richfaces-ui-3.3.3.Final.jar

commons-beanutils-1.8.3.jar

commons-collections-3.2. 1.jar

commons-digester-2.0.jar

commons-logging-1.1.1.jar

jsf-api.jar (for JSF2)

jsf-impl.jar(for JSF2)

HTH.


You can try this RichFaces 4 template for Tomcat 6: http://mkblog.exadel.com/2010/06/richfaces-4-alpha-2-is-now-available-project-template/ . Just replace the alpha version with M1 version. Also, starting with RichFaces 4, there is zero configuration.


What exactly is the problem you have? Lot of configurations? A too huge web.xml? Well, that's what you get for it. Either just follow the documentation carefully - it's clear enough, or just look for another component library which require less configuration, like PrimeFaces. Basically all you need to add is a single resource servlet.

If you want more assistance in getting RichFaces to work, you'll really need to be more clear about the actual problem. "Lot of configurations" isn't a technical problem. It's between your ears. Error/warning messages and odd symptoms are real problems. You should elaborate about that instead.


Well, I figure out that him say a 'lot of configurations' because is not just what he is trying to do with his project, I have the same problem, I need run an JSF 1.2 app with Richfaces 3.3.3 on Glassfish 3; but the app is big that change the Richfaces version is not an option; we just need the app just as is running in gf3 with minimal changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消