我希望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