Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tld file mandatory elements

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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!!
     
    Greenhorn
    Posts: 22
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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 VI Editor Ubuntu
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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 VI Editor Ubuntu
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    No, you're probably looking at an old DTD.
     
    Ranch Hand
    Posts: 63
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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 VI Editor Ubuntu
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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)
     
    Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
    We need your help - Coderanch server fundraiser
    https://coderanch.com/t/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic