2011-04-22 83 views
5

我想RichFaces的加入JSF 2.0应用程序中使用的RichFaces 4,但我得到这个: The requested resource() is not available. 这是从控制台:在JSF 2.0应用程序

java.lang.ClassNotFoundException: org.ajax4jsf.Filter 

我的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" id="WebApp_ID" version="3.0"> 
    <display-name>RichFaces4Test</display-name> 
    <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> 
    <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> 


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

我的lib目录:

enter image description here

回答

12

由于RichFaces 4.0,您不需要org.ajax4jsf.Filter。这也不包括在RF 4.0中。请阅读developer guide for RichFaces 4.0,而不是RichFaces 3.x或更旧版本。对于RF 4.0,您无需将任何东西放入web.xml。只要删除整个<filter><filter-mapping>

+0

感谢您的回答。现在我有另一个问题。组件不渲染。例如,当我尝试这个演示:http://livedemo.exadel.com/richfaces-demo/richfaces/tabPanel.jsf?c=tabPanel&tab=usage我得到这样的事情:“这是一个默认选项卡面板3标签。 j_id1475365623_57f04a9f j_id1475365623_57f04a9f j_id1475365623_57f04a9f j_id1475365623_57f04a75 j_id1475365623_57f04a75 j_id1475365623_57f04a75 j_id1475365623_57f04a6b j_id1475365623_57f04a6b j_id1475365623_57f04a6b « ↓ » 这里是标签# “ – 2011-04-22 17:54:59

+4

这是一个不同的问题。你最初的问题是关于过滤器上的一个'ClassNotFoundException'。如果您有新问题,请按“提问”。评论不是发布新问题/答案的正确地方。 – BalusC 2011-04-22 17:55:26