This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

composite component not working

 
Elizabeth Tom
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 90
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic