my dog learned polymorphism*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Is this a valid tag definition ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Is this a valid tag definition ?" Watch "Is this a valid tag definition ?" New topic
Author

Is this a valid tag definition ?

Abhishek Sharma
Ranch Hand

Joined: Jan 09, 2006
Posts: 68
Hi Ranchers,

Is following tag definition is valid and if yes then what is the significance of <tei-class>MyTagInfo</tei-class>






-Abhishek
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
well... on very first thoughts.. this is what i think -

tei stands for "tag extra information"
so <tei-class> means a class that give some extra information to a tag.
now the question is, which tag ? the pbvious answer is - your tag.

so to sum up - "when you use the tag "myTag" in your JSP, the tag handler that will be executed is "MyTag.java" and the <tei-class> element is like telling the container - 'when MyTag.java will run, it will need some extra information, that should be picked from MyTagInfo.java".

to add to this - from my experience at job - if MyTag.java doesnt find the tei class you are sure to get a run time error when the page is requested.


this does sound logical for me (i didnt google, nor did i found anything in the servelt/jsp specs)

correct me if i am wrong


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Niranjan Basnayake
Ranch Hand

Joined: Mar 25, 2006
Posts: 58
<taglib>
...
<tag>

<name>myTag</name>
<tag-class>MyTag</tag-class>
<body-content>JSP</body-content>

<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>
...
</taglib>

i know the above code is OK.was your code on a mock exam?

is there a valid tag <type> inside <attribute> tag?


SCJP,SCWCD
Abhishek Sharma
Ranch Hand

Joined: Jan 09, 2006
Posts: 68
Well <type> is an optional but valid tag inside <attribute> tag, and yes i got this question in a mock exam.

this does sound logical for me (i didnt google, nor did i found anything in the servelt/jsp specs)
Regarding the defination of <tei> tag Niranjan are you sure of it ???
Tridib Samanta
Ranch Hand

Joined: Apr 28, 2004
Posts: 128
what is the significance of <tei-class>MyTagInfo</tei-class>


<tei-class> specifies a subclass of TagExtraInfo.

This class can be used:
�to indicate that the tag defines scripting variables
�to perform translation-time validation of the tag attributes.


For more details check out JSP.13.9.8 in JSP 2.0 spec.


Thanks, Tridib
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this a valid tag definition ?
 
Similar Threads
Problems making Struts/JSTL 1.2 site work with JSTL 2.0
Doubts
<taglib > doubt
TLD replated doubt
mandatory attributes for c:forEach