Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Clarification needed on variable tag and TagExtraInfo

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi Brown,
Thanks for your response and wishes. The explanation is appreciable and helpful.
Kind Regards
Durvasula
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic