We are migrating JSF1.2 to JSF2 application and I have bumped into a problem with custom components. We have a seperate jar with components, and in that jar I have this:
@FacesComponent(value = "Panel2")
public class Panel2 extends UIOutput { ... }
In my taglib under META-INF I have this:
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
id="mw">
<namespace>http://www.ssss.be/jsf/mw</namespace>
<composite-library-name>mw</composite-library-name>
<tag>
<tag-name>panel2</tag-name>
<component>
<component-type>Panel2</component-type>
</component>
</tag>
</facelet-taglib>
After making a jar of this all and use it in my other project, I use the tag as follows:
xmlns:mw="http://www.ssss.be/jsf/mw"
And then:
<mw:panel2 />
But the result is unfortunately:
javax.faces.FacesException: Expression Error: Named Object: Panel2 not found. at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1858)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1129)
What am I doing wrong here?
metadata-complete
attribute in faces-config.xml set to true.WEB-INF/classes
; or, if in a jar in WEB-INF/lib
, that the jar contains a faces-config.xml (the spec doesn't require annotation scanning otherwise)Panel2
component-type defined in an XML configuration file (this listing will take precedence)See the JSF 2 spec; section 11.5.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With