index.xhtml (eclipse juno 4.2 + JBoss AS 7.1) 1 ページのみの基本的な動的 Web プロジェクトを作成しました。Web ページを実行すると、ブラウザには jsf ではなく html 要素のみが表示されます。私の 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>
「OK」ボタンしか見えません。サーバー(スタンドアロン)を起動すると、次の警告が表示されます。
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) に表示されません。