gpt4 book ai didi

java - 美女,还没解决?

转载 作者:行者123 更新时间:2023-11-29 03:33:52 26 4
gpt4 key购买 nike

我正在尝试将自定义 URL 构建为 prettyfaces告诉它可以,但是在设置它之后,它给了我这个错误:

Referenced file contains errors (http://ocpsoft.org/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd). For more information, right click on the message in the Problems View and select "Show Details..."

这就是我的 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>BRAINSET</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.xhtml</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>*.xhtml</url-pattern>
</servlet-mapping>
<filter>
<filter-name>Pretty Filter</filter-name>
<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
<async-supported>true</async-supported>
</filter>

<filter-mapping>
<filter-name>Pretty Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
<dispatcher>ASYNC</dispatcher>
</filter-mapping>
</web-app>

还有我的 pretty-config.xml :

<pretty-config xmlns="http://ocpsoft.org/prettyfaces/3.3.3" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.org/prettyfaces/3.3.3
http://ocpsoft.org/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd">

<url-mapping id="home">
<pattern value="/home" />
<view-id value="/index.xhtml" />
</url-mapping>

由于这个错误,我什至无法在 Glassfish 中部署我的应用程序:

Could not publish to the server.
java.lang.NullPointerException

知道如何解决这个问题吗?或者我应该寻找另一个类似于 prettyfaces 的工具吗?

更新

enter image description here

最佳答案

我不认为这个错误是由 PrettyFaces 引起的。 XML 模式在我的 Eclipse 设置中运行良好,我没有收到任何这些错误。而且我非常确定 XSD 文件是有效的。

您应该查看 Eclipse 日志文件 (WORKSPACE/.metadata/.log),看看是否有任何异常抛出。

顺便说一句:您也可以尝试从您的 pretty-config.xml 中删除 schemaLocation 元素并检查这是否有帮助。 PrettyFaces 在解析文件时不使用 XSD 架构。像这样:

<pretty-config xmlns="http://ocpsoft.org/prettyfaces/3.3.3">
...
</pretty-config>

关于java - 美女,还没解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16554812/

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