Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

jsf composite component in dependency

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a java application project called mycomposites, i created xhtml with a composite component interface and implementation in
mycomposites/src/main/resources/testcomponents/myComponent.xhtml

Then I created a new project testmycomposites added mycomposites as dependency. Here is the source of an xhtml that should use myComponent:




However running project, I get error:
<tp:myComponent> Tag Library supports namespace: http://java.sun.com/jsf/composite/testcomponents, but no tag was defined for name: myComponent

If i put the same custom component in resources/testcomponents folder of the same project everything works fine.

I can't find any example in wich custom composite components are located in a dependency.

Is it wrong xml namespace or what?

Thanks in advance for reply.
 
Saloon Keeper
Posts: 22498
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might help:

http://www.mkyong.com/jsf2/composite-components-in-jsf-2-0/
 
serafino lillo
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I started from there, but in that example the composite component is not added as a dependency, but it is put in the same project.
 
Tim Holloway
Saloon Keeper
Posts: 22498
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are saying that you are bundling this component in a separate jar to be included in other projects, then you will have to include a meta-inf file in the component's jar to help JSF properly register it.

I'm not free to locate the details on that right now, but you might have luck with a web search.
 
serafino lillo
Greenhorn
Posts: 13
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved moving myComponent.xhtml

from

mycomposites/src/main/resources/testcomponents/myComponent.xhtml

to

mycomposites/src/main/resources/META-INF/resources/testcomponents/myComponent.xhtml

Thanks!
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic