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
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
posted 18 years ago
Hi Brown, Thanks for your response and wishes. The explanation is appreciable and helpful. Kind Regards Durvasula
SCJP2, SCWCD, SCBCD, SCDJWS, SCEA
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!