• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

custom tag reused by container

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!,
I have some questions regarding classic tags.
Can someone tell me please if the specification dictates that clasic tag handlers are always cached by the container?
I think this can be some source of portability problems when running the tags under different application servers if some of them reuse the tag instance and others don't do that.
It is a bad practice to use instance variables inside a classic tag handler?

Thank you for any reply :-)
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, the specification does mention about the reuse of classic custom tags whereas for simple tags and tag files, new instances are created on every invocation.
its a good idea to reinitialize the values of instance variables after your custom tag finishes its work. say you have some instance variables in your custom tag as: String s and int i. So in the body of doEndTag, just before it returns EVAL_PAGE or SKIP_PAGE, type s="" and i=0. Dont rely on any specific containers behaviour if you want portability.
 
reply
    Bookmark Topic Watch Topic
  • New Topic