【问题标题】:Using RichFaces 4 in a JSF 2.0 application在 JSF 2.0 应用程序中使用 RichFaces 4
【发布时间】:2011-08-10 22:30:54
【问题描述】:

我正在尝试将 RichFaces 添加到 JSF 2.0 应用程序,但我得到了这个: The requested resource () is not available. 那来自控制台:

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>

我的库目录:

【问题讨论】:

    标签: java jsf richfaces


    【解决方案1】:

    从 RichFaces 4.0 开始,您不再需要 org.ajax4jsf.Filter。这也不再包含在 RF 4.0 中。请阅读developer guide for RichFaces 4.0,而不是 RichFaces 3.x 或更早版本的。对于 RF 4.0,您无需在 web.xml 中添加任何内容。只需删除整个&lt;filter&gt;&lt;filter-mapping&gt;

    【讨论】:

    • 感谢您的回答。现在我有另一个问题。组件不渲染。例如,当我尝试这个演示:livedemo.exadel.com/richfaces-demo/richfaces/…我得到的是这样的:“这是默认选项卡面板与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«↓»这里是标签#1。” 跨度>
    • 这是一个不同的问题。您最初的问题是关于过滤器上的ClassNotFoundException。如果您有新问题,请按。评论不是发布新问题/答案的正确位置。
    猜你喜欢
    • 2011-12-25
    • 2012-09-04
    • 2012-04-22
    • 2012-02-20
    • 2011-04-21
    • 1970-01-01
    • 2011-05-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多