gpt4 book ai didi

java - 如何在 JSF2.0 中使用 RichFaces4.0? RichFaces4.0如何配置View Handler?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:17:34 25 4
gpt4 key购买 nike

我正在使用一个使用 RichFaces 4.0 的简单示例程序,但不幸的是我无法为 Richfaces 4.0 配置 View 处理程序。

我的 WEB-INF 文件夹中有以下库

commons-beanutils-1.7.0.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-logging-1.0.4.jar
cssparser-0.9.5.jar
Guava -r08.jar
jsf-api-2.0.4-b09.jar
jsf-impl-2.0.4-b09.jar
jSTL-1.2.jar
richfaces-components-api-4.0.0.20110209-M6.jar
richfaces-components-ui-4.0.0.20110209-M6.jar
richfaces-core-api-4.0.0.20110209-M6.jar
richfaces-core-impl-4.0.0.20110209-M6.jar
sac-1.3.jar

我的 web.xml

<?xml version="1.0" encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ">
<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>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>/faces/*</url-pattern>

</servlet-mapping>

<context-param>

<param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.enableControlSkinning</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.enableControlSkinningClasses</param-name>

<param-value>false</param-value>

</context-param>

<context-param>

<param-name>javax.faces.DEFAULT_SUFFIX</param-name>

<param-value>.xhtml</param-value>

</context-param>

<context-param>

<param-name>javax.faces.STATE_SAVING_METHOD</param-name>

<param-value>server</param-value>

</context-param>

<context-param>

<param-name>javax.faces.PROJECT_STAGE</param-name>

<param-value>Development</param-value>

</context-param>

<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

<login-config>

<auth-method>BASIC</auth-method>

</login-config>

我的面孔-config.xml
<?xml version="1.0" encoding="UTF-8"?>

http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

索引.jsp
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">







开始.xhtml


  xmlns:h="http://java.sun.com/jsf/html"

xmlns:a4j="http://richfaces.org/a4j"

xmlns:rich="http://richfaces.org/rich"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:ui="http://java.sun.com/jsf/facelets">

富脸
  <rich:panel header="RichFaces">





发生了什么,因为我没有任何 View 处理程序,所以当我运行应用程序时,系统会提示我从浏览器下载文件?

如果我包含 jsf-facelets.jar 并在 faces-config.xml 中配置它,那么我在部署时会收到标签库错误。浏览器不显示任何 RichFaces4.0 组件,仅显示文本。

请参阅下面的错误以供引用。

信息:容器 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/RichFacesJSF20] 已经启动

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

信息:从以下位置添加库:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

信息:从以下位置添加库:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

信息:从以下位置添加库:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

信息:从以下位置添加库:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/jsf-facelets.jar!/META-INF/jSTL-core.taglib.xml

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

信息:从以下位置添加库:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/jsf-facelets.jar!/META-INF/jSTL-fn.taglib.xml

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

信息:添加的库来自:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/jsf-impl-2.0.4-b09。 jar !/META-INF/mojarra_ext.taglib.xml

2011 年 2 月 22 日 19:08:52 com.sun.facelets.compiler.TagLibraryConfig loadImplicit

严重:加载库时出错:jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/richfaces-components-ui-4.0.0.20110209- M6.jar!/META-INF/a4j.taglib.xml

java.io.IOException:解析错误 [jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/richfaces-components-ui-4.0 .0.20110209-M6.jar!/META-INF/a4j.taglib.xml]:
    at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410)

at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431)

at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87)

at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)

at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218)

at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149)

at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100)

at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:517)

at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)

at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)

at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:709)

at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:680)

at org.apache.jsp.index_jsp._jspService(index_jsp.java:59)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

at java.lang.Thread.run(Thread.java:662)

引起:org.xml.sax.SAXException:错误处理 [jar:file:/C:/Documents%20and%20Settings/modhas2/My%20Documents/NetBeansProjects/RichFacesJSF20/build/web/WEB-INF/lib/richfaces-组件-ui-4.0.0.20110209-M6.jar!/META-INF/a4j.taglib.xml@2,255]
    at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.error(TagLibraryConfig.java:376)

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1621)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1900)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:764)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1318)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)

at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)

at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)

at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:407)

... 39 more

请建议如何使用 Facelets JSF2.0 使用 RichFaces4.0?

最佳答案

使用 RichFaces 4 时无需配置 View 处理程序。Facelets 是使用的默认 View 处理程序。我建议使用 RichFaces Maven 原型(prototype)创建一个新的 RichFaces 4 项目 - 您将立即获得所需的一切。

关于java - 如何在 JSF2.0 中使用 RichFaces4.0? RichFaces4.0如何配置View Handler?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5082781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com