This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Extending tags etc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Extending tags etc

Chris Lynx
Greenhorn

Joined: Jul 26, 2007
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60810
    
  65

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Extending tags etc
 
Similar Threads
Bean request Scope won't Call method
Extending JSF Components
html:checkbox disable property
Pass expression value to custom tag class?
jakarta-tomcat-4.0.1 taglib problem