我希望eclipse(juno或更早版本)爲我的自定義taglib提出完成建議。自定義jsf taglib自動完成
所以,我寫了一個.taglib.xml文件,其代碼爲:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib id="sc"
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-facelettaglibrary_2_0.xsd"
version="2.0"
>
<namespace>http://www.senat.fr/taglib/sencommons</namespace>
<tag>
<description>
<![CDATA[
blah blah blah
]]>
</description>
<tag-name>senDateYearBegEnd</tag-name>
<component>
<component-type>fr.senat.faces.validators.SenDateYearBegEnd</component-type>
</component>
<attribute>
<description>
<![CDATA[
Identifiant unique.
]]>
</description>
<name>id</name>
<required>false</required>
<type>java.lang.String</type>
</attribute>
[...]
</tag>
</facelet-taglib>
這.taglib.xml文件在META-INF目錄
的例子標籤家常omnifaces版本的ValidateMultiple。
但是,與omnifaces相反(只是一個例子),當我在xhtml文件中使用包含此taglib定義的依賴關係使用此lib時,我在eclipse中沒有完成。
例子:
<html lang="fr"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui"
xmlns:sen="http://java.sun.com/jsf/composite/sen"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:sf="http://www.senat.fr/taglib/senfunctions"
xmlns:sc="http://www.senat.fr/taglib/sencommons"
xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions">
如果鍵入
<o:
然後按CTRL +空間,我得到了提案標籤,然後在屬性。
如果鍵入
<sc:
然後按CTRL +空間,我什麼也沒得到。
我的lib中被定義爲我的項目的依賴的方式一樣omnifaces ...
我什麼也沒看見在omnifaces pom.xml speecial。我該怎麼辦?
是您的自定義標籤庫真的被Maven引用了嗎?這不是真的被Eclipse項目的*部署程序集*所引用嗎?這將解釋找不到taglib文件。 – BalusC
如何檢查1)它是否被maven引用2)它是否被eclipse部署程序集引用?謝謝。 –
Maven:不知道(我不用它來開發,所以不能從經驗中得知)。 Eclipse:檢查項目屬性中的*部署程序集*部分。 – BalusC