2012-04-18 8 views
4

JSF Faceletsアプリケーションに複合コンポーネントを追加しようとしています。次のようにEclipse + JSF + Facelets +複合コンポーネント= CANNOT_FIND_FACELET_TAGLIB

複合成分(email.xhtml)は次のよう

<!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:composite="http://java.sun.com/jsf/composite" 
    xmlns:h="http://java.sun.com/jsf/html"> 

<h:head> 
    <title>This content will not be displayed</title> 
</h:head> 
<h:body> 
    <composite:interface> 
     <composite:attribute name="value" required="false" /> 
    </composite:interface> 

    <composite:implementation> 
     <h:outputLabel value="Email id: "></h:outputLabel> 
     <h:inputText value="#{cc.attrs.value}"></h:inputText> 
    </composite:implementation> 
</h:body> 
</html> 

使用ページ(emailuserpage.xhtml)は:

<!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" 
    xmlns:em="http://java.sun.com/jsf/composite/emcomp/"> 

<h:head> 
    <title>Using a sample composite component</title> 
</h:head> 

<body> 
    <h:form> 
     <em:email value="[email protected]" /> 
    </h:form> 
</body> 
</html> 

私の複合部品へのパスであるsrc/main/webapp/resources/emcomp/email.xhtml 。 ユーザーページへのパスはsrc/main/webapp/emailuserpage.xhtmlです。

しかし、私は両方の

コンパイル時の警告のEclipse JSF HTMLエディタに示されているブラウザに表示されます時間をコンパイルしないとemailuserpage.xhtmlに時間の警告を実行し、(警告メッセージ以外に)何を得る:

Eclipseのブラウザ(web.xmlのjavax.faces.PROJECT_STAGE =開発)に示す
xmlns:em="http://java.sun.com/jsf/composite/emcomp/" 
NLS missing message: CANNOT_FIND_FACELET_TAGLIB in: 
org.eclipse.jst.jsf.core.validation.internal.facelet.messages 

実行時間警告:

Warning: The page /emailuserpage.xhtml declares namespace http://java.sun.com/jsf/composite/emcomp/ and uses the tag em:email , but no TagLibrary associated to namespace. 

私はすでにこの質問(それが問題を解決していない)を見てきました:

Eclipse Java EE IDE for Web Developers 
Version: Indigo Service Release 2 
Build id: 20120216-1857 

任意のアイデア:私はEclipseのバージョンで、m2em2e-wtpプラグインを使用していNLS missing message: CANNOT_FIND_FACELET_TAGLIB

を私が間違ってやっていることについて? 何とか複合コンポーネントを間違って含むか、間違ったディレクトリを使用してリソースを保存していますか? これはEclipse /設定の問題ですか?

[EDIT]

ダニエルさんのコメント

SOURCEディレクトリ構造に対応して:

  • プロジェクト/ srcに/メイン/
    • のjava/
    • Webアプリケーション/

DEPLOYディレクトリ構造:

  • プロジェクト
    • HTMLファイル(emcomp /フォルダを含む)
    • リソース/
    • META-INF/
    • WEB- INF /(設定ファイルとlib /フォルダ)
+0

パスは、src/main/webapp/resources /の代わりにwebapp/resources /にしないでください。 – Daniel

+0

@Daniel、私はデフォルトのMavenディレクトリ構造を使用しています。詳細については、編集した質問を参照してください。 –

+0

ちょうどちょうどちょうどをに置き換えて、このものはJSFを混乱させる可能性があります... – Daniel

答えて

4

XML名前空間URIから末尾のスラッシュを削除します。

xmlns:em="http://java.sun.com/jsf/composite/emcomp" 
+0

完璧、ありがとう –

+2

私は同じ問題を抱えていますが、スラッシュはありません。 –

関連する問題