aspose file tools*
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
JavaRanch » Java Forums » Java » JSF
Bookmark "composite component not working" Watch "composite component not working" New topic
Author

composite component not working

Elizabeth Tom
Greenhorn

Joined: Jan 25, 2011
Posts: 2
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>
<hutputText 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?
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.
Regards
Cesar


When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
 
Don't get me started about those stupid light bulbs.
 
subject: composite component not working