Forums Register Login

composite component not working

+Pie Number of slices to send: Send
Hi,
I created a simple composite compenent test.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cc="http://java.sun.com/jsf/composite">

<cc:interface>
<cc:attribute name="inValue" required="true"/>
</cc:interface>

<cc:implementation>
<h:outputText value ="#{cc.attrs.inValue}"/>
</cc:implementation>
</html>

I placed the file under a directory components, such that after deployment it can be found under WEB-INF/components/test.xthml.

I am trying to access it in another test2.xhtml with namespace as:
xmlns:util="http://java.sun.com/jsf/composite/components"

I refer the component in test2 as follows:
<util:test inValue="123456"/>

My issue is that when I run the application I get the following error:
Warning: This page calls for XML namespace http://java.sun.com/jsf/composite/components declared with prefix util but no taglibrary exists for that namespace.

What am I missing?
+Pie Number of slices to send: Send
Hi Elizabeth

When you're using composite components to eliminate configuration JSF 2.0 uses a convention and for that you must put the composite components in the resources forlder (for convention) at the same level for the WEB-INF, in your case you must put your composite component test.xhtml in a folder named util in the resources folder so

And in the page that you use the composite component you must use the namespace: and your component will be I hope this can solve your problem, If not let me know.
Regards
Cesar

Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 4743 times.
Similar Threads
Mystified by JSF 2 composition components
ajax within a composite component
Composite Components Problem
cc.parent in component compositions not working
Embedding Flex component in JSF 2.0
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:14:28.