Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

Extending tags etc

 
Chris Lynx
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Not sure if this is the right place - I have also posted in JSF, but think its kinda between both lists...

I have just started looking at JSF/JSP etc and am not sure if I am going down the right track with regards to extending the core JSF components.

This is what I have done:

1) I have extended javax.faces.component.html.HtmlCommandButton
2) I have extended com.sun.faces.taglib.html_basic.CommandButtonTag
3) I have registered my extended HtmlCommandButton in faces-config.xml
4) I have created a .tld file which has a tag pointing to my extended CommandButtonTag.

The problem I have is that when i import my taglib into a jsp I dont get any attributes?

Eg if I add an attribute "myAttribute" to my taglib I can reference it from my jsp. However, as my taglib points to my implementation of com.sun.faces.taglib.html_basic.CommandButtonTag I was expecting to be able to get all the attributes associated with it in my jsp.

Therefore I was expecting to be able to do something like:

<myTagLib:myCommandButton value="Test"></myTagLib:myCommandButton>

However, I can not see the value attribute.

Any ideas? Have I gone about JSF component extension in the wrong way?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
    Bookmark Topic Watch Topic
  • New Topic