尝试配置 JSF 时出现名称空间错误
尝试发布到我的服务器时出现以下错误。我已经下载了 apache myfaces 2.0。我还将它们添加为 eclipse 中的库,并添加了 JSF 2.0 的项目方面。
由以下原因引起:org.apache.xmlbeans.XmlException:无效部署 描述符: 错误: jar:文件:/C:/DOCUME~1/shawt/LOCALS~1/Temp/geronimo-deployer7810915779003395233.tmpdir/Scout.war!/WEB-INF/faces-config.xml:2:1: 错误:cvc-enumeration-valid:字符串值“2.0”无效 命名空间中 faces-config-versionType 的枚举值 http://java.sun.com/xml/ns/javaee
这是我的< code>faces-config:
<?xml version="1.0"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<navigation-rule>
<from-view-id>menu.jsp</from-view-id>
<navigation-case>
<from-action>#{pageController.processPage1}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>test.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
这是我的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_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Scout</display-name>
<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>*.jsp</url-pattern>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app>
I am getting the following error when trying to publish to my server. I have downloaded apache myfaces 2.0. I have also added these as a library in eclipse and added the project facet for JSF 2.0.
Caused by: org.apache.xmlbeans.XmlException: Invalid deployment
descriptor: errors:
jar:file:/C:/DOCUME~1/shawt/LOCALS~1/Temp/geronimo-deployer7810915779003395233.tmpdir/Scout.war!/WEB-INF/faces-config.xml:2:1:
error: cvc-enumeration-valid: string value '2.0' is not a valid
enumeration value for faces-config-versionType in namespace
http://java.sun.com/xml/ns/javaee
Here is my faces-config
:
<?xml version="1.0"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<navigation-rule>
<from-view-id>menu.jsp</from-view-id>
<navigation-case>
<from-action>#{pageController.processPage1}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>test.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Here is my 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_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Scout</display-name>
<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>*.jsp</url-pattern>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论