| Author |
taglib custom tags
|
Stefano Cazzola
Greenhorn
Joined: Apr 21, 2011
Posts: 6
|
|
Hi everybody.
I'm new to JSP programming, even if I have a fair knowledge of Java.
I would like to use custom tags, and to nest them into each other attributes... something like that
I've seen many tags used like this (as c:url for examble) but I'm not able to do this.
Can anybody help me?
Thanks,
Stefano
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
|
No, you haven't seen that. You cannot use a custom tag as an attribute value of another custom tag.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Stefano Cazzola
Greenhorn
Joined: Apr 21, 2011
Posts: 6
|
|
Actually, you are right. I didn't see that. I saw (and used)
I supposed it was a standard behavior and that it was possible also with custom tags.
However I found a solution (quite verbose but effective) to use the output of a custom tag as value for an attribute of another custom tag
Stefano
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
Stefano Cazzola wrote:I supposed it was a standard behavior and that it was possible also with custom tags.
Ahhhh! This is an important distinction. HTML tags, and all other client-side markup is just template text to the JSP engine. It could be the Magna Carta as far as the JSP engine is concerned -- it doesn't apply any semantics to it whatsoever.
However I found a solution (quite verbose
The more standard way is to store the output of the custom tag in a scoped variable, and then use the EL to supply that value as the attribute value.
|
 |
Stefano Cazzola
Greenhorn
Joined: Apr 21, 2011
Posts: 6
|
|
Thanks Bear!
I'll follow the standard way, then.
Bye,
Stefano
|
 |
 |
|
|
subject: taglib custom tags
|
|
|