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

Is this a valid tag definition ?

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

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






-Abhishek
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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?
 
Abhishek Sharma
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ???
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic