java - 在 JSF 2.0 应用程序中使用 RichFaces 4

标签 java jsf richfaces

我正在尝试将 RichFaces 添加到 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>

我的库目录:

enter image description here

最佳答案

从 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> .

关于java - 在 JSF 2.0 应用程序中使用 RichFaces 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5755107/

相关文章:

java - 如何在 finally block 的事务上下文中处理异常?

java - Lucene 语义索引

java - 用于在表单中填充今天日期的链接

javascript - Richfaces 4.x 日历组件 ondateselected 事件

java - JGraphT - UndirectedGraph - addEdge 方法不起作用

unit-testing - JSFUnit 是否测试 Web 应用程序的所有方面?

jsf - 尝试在 EL 中连接字符串时出现 NumberFormatException

css - 在 h :commandbutton from CSS is not working 中设置背景图片

java - List Shuttle 的用途是什么

Java:如何获取UTC时间戳 '1000-01-01 00:00:00'?