• Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Tag Life Cycle  RSS feed

 
Stefan Krause
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a custom tag that can have multiple occurrence on one page. Does the spec guarantee that for each occurrence a new instance of the tag is created? (regarding tomcat: What's that _jspx_tagPool_xyz_img_src_border.reuse call tomcat creates) If the same instance can be reused what happens with optional attributes?
Thanks,
Stefan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. In fact, most modern containers will aggressively reuse the tag instances.
The behavior I've generally seen is that the container will create one tag instance for each distinct combination of optional attributes. That's a clever way to ensure that "left-over" values don't "bleed over".
hth,
bear
 
Stefan Krause
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the question arises: Should I clean my optional attributes after doEndTag? I once ran into a case where optional attributes remained with the value from a preceding invocation - but I couldn't reproduce this, so I'm just 99% sure about that.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not have to. If you do, I'd consider it a bug in the container. What are you using?
bear
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!