• 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

Clarification needed on variable tag and TagExtraInfo

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am planning to take the exam next week. Could anybody help me in clarifying my doubt.
Taglib1.2 dtd specifies <variable> tag which describes on scripting variable. This can be done normally in the TagExtraInfo class. For normal creation of scripting variables we dont really need to implement the isValid(). So, could we alternatively use <variable> tag to define scripting varibale instead of creating a TagExtraInfo class. What are the pros and cons of these 2 approaches.
Thanks in Advance
Durvasula
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Essentially one is declarative, whereas one is programmatic. The TagExtraInfo class was introduced before JSP 1.2 and apart from existing for backwards compatability, there is another good reason for it.
Imagine that you are trying to implement a copy of the <jsp:useBean> tag which looks up an object and introduces it into the page as a scripting variable. There is no way that you can know in advance what type (class) that variable might be and this, therefore, means that you can't use the <variable> tag to define the variable. Instead, you must use the TEI class.
Basically, the <variable> attribute is useful if you know the type of the variable, whereas the TEI class is useful if you want to programmatically determine some of the variable's properties.
Hope that helps and good luck with the exam.
Regards
Simon
 
Bhagawanlu Durvasula
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Brown,
Thanks for your response and wishes. The explanation is appreciable and helpful.
Kind Regards
Durvasula
 
Don't listen to Steve. Just read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic