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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5755107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 12:36:28  来源:igfitidea点击:

Using RichFaces 4 in a JSF 2.0 application

javajsfrichfaces

提问by Evgeni Dimitrov

I'm trying to add RichFaces to JSF 2.0 application, but I get this: The requested resource () is not available.That's from Console:

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

java.lang.ClassNotFoundException: org.ajax4jsf.Filter

My web.xml:

我的 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>

My lib dir:

我的库目录:

enter image description here

在此处输入图片说明

回答by BalusC

Since RichFaces 4.0 you do not need the org.ajax4jsf.Filter. This is also not included in RF 4.0 anymore. Please read the developer guide for RichFaces 4.0, not the one for RichFaces 3.x or older. For RF 4.0 you do not need to put anything in web.xml. Just remove the entire <filter>and <filter-mapping>.

从 RichFaces 4.0 开始,您不需要org.ajax4jsf.Filter. 这也不再包含在 RF 4.0 中。请阅读RichFaces 4.0开发人员指南,而不是 RichFaces 3.x 或更早版本的指南。对于 RF 4.0,您无需在web.xml. 只需删除整个<filter><filter-mapping>