[英]Eclipse xmlns:h=“http://java.sun.com/jsf/html” not recognized?
I am having issues with loading the JSF Library in my Eclipse project. 我在Eclipse项目中加载JSF库时遇到问题。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>#{msgs.windowTitle}</title>
</h:head>
<h:body>
#{msgs.pageTitle}
<h:form>
<h:dataTable value="#{tableData.names}" var="name">
<h:column>
#{name.last},
</h:column>
<h:column>
#{name.first}
</h:column>
</h:dataTable>
</h:form>
</h:body>
</html>
it seems like the xmlns:h="http://java.sun.com/jsf/html"
isn't being recognized/resolved ? 似乎无法识别/解析
xmlns:h="http://java.sun.com/jsf/html"
吗? When I run the index.xhtml file in Eclipse, i get the following output: 当我在Eclipse中运行index.xhtml文件时,得到以下输出:
#{msgs.pageTitle} #{name.last}, #{name.first}
rather than the expected output data tables from my class files. 而不是我的类文件中的预期输出数据表。
Below is my faces-config.xml: 下面是我的faces-config.xml:
<?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
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<resource-bundle>
<base-name>com.corejsf.messages</base-name>
<var>msgs</var>
</resource-bundle>
</application>
</faces-config>
Problem solved! 问题解决了! I was actually running the XHTML file rather than the entire project.
我实际上是在运行XHTML文件,而不是整个项目。 Running the entire project works perfectly!
运行整个项目非常完美!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.