Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tld file mandatory elements

 
Yoshita Jain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the mandatory elements of the tag library descriptor file?

Are all of these elements mandatory?

<tlibversion>
<jspversion>
<shortname>
<tag>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jspversion ? I think that you are referring to an old DTD for TLD 1.1.
Look at a XML Schema file describing a Tag Library Descriptor in a
JSP 2.0 format. You will find one in the specification. You will that the following are mandatory in <taglib> :
  • tlib-version
  • short-name
  •  
    Yoshita Jain
    Greenhorn
    Posts: 23
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes.. it was an old struts TLD I had referred to and this was also in a question I had come across.
    But yeah HFSJ also says <tlib-version> and <short-name> as mandatory.
    Thanks!!
     
    Ronaldo Nazario
    Greenhorn
    Posts: 22
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hmmm... now I'm confused...

    So, <short-name> is a mandatory element?
    I thought that mandatory meant: "don't put it and get an error!", but i've got a .tld without a <short-name> and it works just fine.

    So, what does mandatory mean?
     
    Christophe Verré
    Sheriff
    Posts: 14691
    16
    Eclipse IDE Ubuntu VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    i've got a .tld without a <short-name> and it works just fine.

    Yep, I've got one too. But the exam does not ask you how your container will react when you try this and that. It's all about what the specification tells. And it says that the short-name is mandatory. Your container just doesn't care By the way, you'll also see that the container is supposed to generate a TLD for tag files under WEB-INF/tags. When it does, it is supposed to generate both tlib-version and short-name.
     
    Ronaldo Nazario
    Greenhorn
    Posts: 22
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    <tlib-version>
    <jsp-version>
    <short-name>
    <uri>
    <tag>

    are all mandatory elements in a taglib, right?
     
    Christophe Verré
    Sheriff
    Posts: 14691
    16
    Eclipse IDE Ubuntu VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    No, you're probably looking at an old DTD.
     
    Abdul Rahman
    Ranch Hand
    Posts: 63
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    hi,

    i was going through the jsp-2_0-fr-spec.pdf from sun's website. Page#400 of this spec has a graphic representation of the tld element. The DTD symbols and their meaning as i know is something like this:
    * an asterisk (*) indicates the element may be present 0 or more times;
    * a plus (+) one or more times;
    * a question mark (?) 0 or 1 times;
    * and in the absence of a symbol the element is required once and only once.
    The graphical rep of the tld element in the jsp spec suggests that:
    description, display-name, icon, listener , tag, tag-file, function may be present 0 or more times.
    My question is does the jsp2.0 spec allows to have more than one description element. am i reading the graph correctly ?

    Can anyone please help me out. i am a bit puzzled by this graphical representation and the description provided below in the spec doesn't hit my brain.

    Thanks
     
    Christophe Verré
    Sheriff
    Posts: 14691
    16
    Eclipse IDE Ubuntu VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    My question is does the jsp2.0 spec allows to have more than one description element.

    Yes it does.

    (please start a new thread next time)
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic