2011-04-22 101 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

相關問題