*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes tld file mandatory elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "tld file mandatory elements" Watch "tld file mandatory elements" New topic
Author

tld file mandatory elements

Yoshita Jain
Greenhorn

Joined: Sep 15, 2007
Posts: 23
What are the mandatory elements of the tag library descriptor file?

Are all of these elements mandatory?

<tlibversion>
<jspversion>
<shortname>
<tag>
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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


  • [My Blog]
    All roads lead to JavaRanch
    Yoshita Jain
    Greenhorn

    Joined: Sep 15, 2007
    Posts: 23
    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

    Joined: Sep 30, 2007
    Posts: 22
    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

    Joined: Nov 24, 2005
    Posts: 14687
        
      16

    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

    Joined: Sep 30, 2007
    Posts: 22
    <tlib-version>
    <jsp-version>
    <short-name>
    <uri>
    <tag>

    are all mandatory elements in a taglib, right?
    Christophe Verré
    Sheriff

    Joined: Nov 24, 2005
    Posts: 14687
        
      16

    No, you're probably looking at an old DTD.
    Abdul Rahman
    Ranch Hand

    Joined: Jul 04, 2008
    Posts: 63
    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


    Abdul
    SCJP5, SCWCD5, [scwcd wall of fame]
    Christophe Verré
    Sheriff

    Joined: Nov 24, 2005
    Posts: 14687
        
      16

    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)
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: tld file mandatory elements