This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • 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: 66187
148
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: 66187
148
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!