我用一页 index.xhtml (eclipse juno 4.2 + JBoss AS 7.1) 制作了基本的动态 web 项目。当我运行我的网页时,浏览器只显示 html 元素而不是 jsf。我的 index.xhtml 代码:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
push the button:
<button>ok</button>
<h:button value="not ok"></h:button>
</body>
</html>
我只能看到“确定”按钮。当我启动我的服务器(独立)时,我有警告:
WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
WARNING [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) JSF1069: Disabling the JSF 2.0 Facelets ViewHandler as an older FaceletViewHandler, com.sun.facelets.FaceletViewHandler, has been explicitly configured. If this is not desired behavior, remove the older FaceletViewHandler and library from your application.
有没有人有同样的问题?我犯了错误或IDE或服务器有一些错误?感谢帮助。
我还有另一个问题。我想添加库 primafaces。我右键单击项目,然后属性-> 部署程序集-> 添加,.jar 显示在管理窗口中,但库没有出现在文件层次结构(WEB-INF/lib)中。