• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tagfile attributes and parameters

 
John Hyde
Greenhorn
Posts: 10
Java Oracle Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing a custom tag using tag files only. I understand that I can read the attributes of a tagfile by <%@attribute name="" %>, but can I read anything which is passed in the tag body?
i.e

I can get the attribute by

but how do I read the param values? is it even possible?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The obvious question is, why would you do that? It's just awful design in my opinion. If you want to pass data to the tag, that's what the attributes are for.

Or are you really asking a more general question about dealing with child elements?
 
John Hyde
Greenhorn
Posts: 10
Java Oracle Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:The obvious question is, why would you do that? It's just awful design in my opinion. If you want to pass data to the tag, that's what the attributes are for.

Or are you really asking a more general question about dealing with child elements?


I need to pass a list of values, right now I'm accomplishing this by having two attributes like


I feel passing parameter list is much cleaner
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's been a long time since I futzed around with JSP tag files, but I'm not sure you are going to be able to do what you want with them. (But I could be wrong.)

Dealing with child tags is relatively straight-forward using SimpleTags.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic