Question

I am looking around how to define custom components in JSF. According to the Java EE tutorial, any custom component needs to be described in a taglib. When I take a look into the PrimeFaces source, I cannot find any taglib file or any hint where the namespace is bound and the available components are defined. I am adding primefaces jar to my dependencies, adding

xmlns:p="http://primefaces.org/ui

to the xml namespace, defining some primfaces components on my page and it works...

Ok, but neither I can find the related taglib in the source or binary package nor my IDE (IntelliJ) is able to find where "xmlns:p="http://primefaces.org/ui" is pointing to. Therefore, code completion is also not possible. (all other mojarra taglibs are found.)

Is it possible that PrimeFaces is defining the taglib via annotations directly in Java classes or is it generating it during runtime? I can easily find the UIComponents, primefaces defines in its source, but the configuration of the taglib seems to be missing. I am sure I just don't know how PrimeFaces is doing it, but the javaeetutorial is not describing any other opportunity than defining a ...-taglib.xml

Was it helpful?

Solution

Ok, I found out that the config is generated via build, but the download of the sources doesn't contain a build script.

Via github, I found my answer, it is created during build( via maven)

(https://github.com/primefaces/primefaces/blob/master/pom.xml)

OTHER TIPS

Is it possible that PrimeFaces is defining the taglib via annotations directly in Java classes or is it generating it during runtime? [...] the javaeetutorial is not describing any other opportunity than defining a ...-taglib.xml

As PrimeFaces 4 is JSF 2.2 compatible it could theoretically have done just that. Namely, in JSF 2.2/Java EE 7 it's indeed possible to define a Facelets tag directly via an annotation. For more details about this see: http://arjan-tijms.omnifaces.org/p/jsf-22.html#594

Since PrimeFaces 4 is still JSF 2.1/2.0 compatible it seems they haven't done it yet as you discovered in the meantime.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top