• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF Custom Component - Facelets

 
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all.

I've developed a JSF custom component (JSF 1.2), and it works normally within JSP pages.
So, when I try do use my component in a Web Application with Facelets, I cannot declare my namespace component
inside XHTML. Normally, with other components (i.e. tomahawk), the namespaces are recognized inside Eclipse editor
and the code assist helps us to autocomplete the URI.

Does anybody already have the same problem?

Thanks.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure how much of what you're complaint is is about Eclipse and how much is about JSF.

Facelets requires a somewhat different method of declaration for JSF component properties and methods than what you do in straight JSF or JSP. If you don't provide this declaration file, you'll have problems rendering the page.

Eclipse auto-complete needs XML schema information if it's going to be able to provide code assist to people using the editor. But that's an entirely different bucket of worms.
 
Adolfo Eloy
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Holloway for the answer.

I've downloaded the tomahawk source code to inspect how it was made to work in facelets projects.
So I didn't find such a schema to be used by my IDE.
The only thing I found different there was a file tomahawk.taglib.xml which I tried to create something like it inside my project.
But I have no success.

Could you tell me where to find related documents which can help me to write JSF Component that are Facelets complaint?

Thanks.
 
Tim Holloway
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The taglib.xml file is what you need. I'd have to Google for information on it, though, since I don't remember where I found the docs on setting one up.
 
Ranch Hand
Posts: 121
Mac Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for the custom components you need both <name>taglib.xml file and <name>.tld file which you should store in META-INF folder.
for the third party libraries like myfaces or tomhawk you should redeclare them in <name>taglib.xml file which again should be stored in META-INF folder.(tld files will be already present so no need of tlds again in META-INF folder)
Facelets will directly look into the META-INF directory for the definations of unkown tags.
 
Adolfo Eloy
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:The taglib.xml file is what you need. I'd have to Google for information on it, though, since I don't remember where I found the docs on setting one up.



I found the documents about taglib.xml on https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib

suresh dasari wrote:for the custom components you need both <name>taglib.xml file and <name>.tld file which you should store in META-INF folder.
for the third party libraries like myfaces or tomhawk you should redeclare them in <name>taglib.xml file which again should be stored in META-INF folder.(tld files will be already present so no need of tlds again in META-INF folder)
Facelets will directly look into the META-INF directory for the definations of unkown tags.



Suresh, it was exactly what I was needing to do:
- use the same name for <name>.tld and <name>taglib.xml when declaring my integration tag files.
- placing only the taglib.xml into META-INF.

To facilitate the using and right generation of my component I'm currently using Maven Archetypes for JSF Custom Component.


Tim Holloway and Suresh Dasari,
Thanks for help!

 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic