aspose file tools*
The moose likes JSP and the fly likes taglib custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "taglib custom tags" Watch "taglib custom tags" New topic
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: 61239
    
  66

No, you haven't seen that. You cannot use a custom tag as an attribute value of another custom tag.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 61239
    
  66

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: taglib custom tags