• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Tagfile attributes and parameters

 
Greenhorn
Posts: 10
Python Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Python Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67682
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic