Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

composite component not working

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
<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?
 
Ranch Hand
Posts: 90
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
reply
    Bookmark Topic Watch Topic
  • New Topic