Search code examples
jsfjakarta-eenetbeanscustom-component

Customize default taglib prefix


I don't know if this has a solution or is an IDE enhancement, but, when I'm using primefaces components in Netbeans, the autocomplete suggest the taglib p:..., no matter the id is http://primefaces.org/ui (should suggest pou), but if you're using primefaces extensions instead give pe as the showcase, gives poue.

So, now, I created a custom tag lib with id http://zeitek.net/ui, but as extensions is suggested znu, I know I can change it manually, but since is a collaborative project, I would like to use ztk as the predefined prefix to keep the standard in the code, is there anyway to achieve this with a JSF parameter or Netbeans configuration?


Solution

  • Well, if someone need this, i was missing this: You need to create a tag-lib like normal and add this param:

    <facelet-taglib
    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"
    id="zinf">
    <namespace>http://zeitek.net/infraction/jsf/ui</namespace>
    <composite-library-name>zinf</composite-library-name>
    

    The last part is the important one: < composite-library-name>zinf< /composite-library-name>