It's not a secret anymore!
The moose likes JSF and the fly likes composite component not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "composite component not working" Watch "composite component not working" New topic

composite component not working

Elizabeth Tom

Joined: Jan 25, 2011
Posts: 2
I created a simple composite compenent test.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns=""

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

<hutputText value ="#{cc.attrs.inValue}"/>

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:

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 declared with prefix util but no taglibrary exists for that namespace.

What am I missing?
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

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.

When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
I agree. Here's the link:
subject: composite component not working
It's not a secret anymore!