Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exact location of ".tld"

 
Yosi Pramajaya
Ranch Hand
Posts: 46
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I want to take an OCEWCD Java EE 6.
But, I want to ask something when I learn from a book.

Where's the exact location of a .tld files?
I've read a topic, that said it only can be located in WEB-INF directory or it's subdirectory.

But I've read here Oracle's DOCS.
That said we can include .tld in META-INF directory or it's subdirectory.

Now, what's the exact position of .tlds?
 
Gaurangkumar Khalasi
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.tld can be located in WEB-INF directory or it's subdirectory and also in META-INF directory or it's subdirectory...
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yosi Pramajaya wrote:Hello, I want to take an OCEWCD Java EE 6.
But, I want to ask something when I learn from a book.

Where's the exact location of a .tld files?
I've read a topic, that said it only can be located in WEB-INF directory or it's subdirectory.

But I've read here Oracle's DOCS.
That said we can include .tld in META-INF directory or it's subdirectory.

Now, what's the exact position of .tlds?


You said you want to appear for OCEWCD 6 but i see that you are referring javadocs for j2ee 1.4. i recommend you reading tutorials for java ee 6 which is available on oracle site in pdf as well as html format
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2449
96
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

To be a little more precise, these are the general rules:

The TLD file
Explicit mapping:
the taglib directive in a JSP-file has an URI that corresponds with a <taglib-uri> in the <taglib> element of the web.xml. The location of the TLD file is found in the <taglib-location> element.

Implicit mapping:
the taglib directive in a JSP-file has an URI that doesn't match any <taglib-uri> in the <taglib> element of the web.xml. The JSP container gets the location by searching the subdirectories of /WEB-INF and the jar's in /WEB-INF/lib for a TLD file with a matching URI.

  • the fallback rule allows a taglib directive to refer directly to the TLD. This arrangement is very convenient for quick development at the expense of less flexibility and accountability. For example: <%@ taglib uri="/WEB-INF/tlds/PRlibrary_1_4.tld" prefix="x" %>


  • The URI in the taglib directive doesn't point to anything (with exception of the fallback-rule) it only has to match the corresponding <taglib-uri> setting in the web.xml or the optional <uri> attribute in the TLD-file.


  • The .tld files within a jar file must have a path that begins with /META-INF


  • Regards,
    Frits
     
    vipul bondugula
    Ranch Hand
    Posts: 222
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Frits Walraven wrote:Hi Guys,

    To be a little more precise, these are the general rules:

    The TLD file
    Explicit mapping:
    the taglib directive in a JSP-file has an URI that corresponds with a <taglib-uri> in the <taglib> element of the web.xml. The location of the TLD file is found in the <taglib-location> element.

    Implicit mapping:
    the taglib directive in a JSP-file has an URI that doesn't match any <taglib-uri> in the <taglib> element of the web.xml. The JSP container gets the location by searching the subdirectories of /WEB-INF and the jar's in /WEB-INF/lib for a TLD file with a matching URI.

  • the fallback rule allows a taglib directive to refer directly to the TLD. This arrangement is very convenient for quick development at the expense of less flexibility and accountability. For example: <%@ taglib uri="/WEB-INF/tlds/PRlibrary_1_4.tld" prefix="x" %>


  • The URI in the taglib directive doesn't point to anything (with exception of the fallback-rule) it only has to match the corresponding <taglib-uri> setting in the web.xml or the optional <uri> attribute in the TLD-file.


  • The .tld files within a jar file must have a path that begins with /META-INF


  • Regards,
    Frits



    what frits said , those rules are in J2EE 1.4.. In J2EE 6, drop your tld file in WEB-INF (or) sub-directory of WEB-INF (or) in META-INF. refer the tld file in jsp using uri in tld file. server is smart enough to detect the tld file. instead of uri, can also use tld location.
     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Saloon Keeper
    Pie
    Posts: 2449
    96
    Android Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    what frits said , those rules are in J2EE 1.4.. In J2EE 6, drop your tld file in WEB-INF (or) sub-directory of WEB-INF (or) in META-INF. refer the tld file in jsp using uri in tld file. server is smart enough to detect the tld file. instead of uri, can also use tld location.


    If you check the JSP 2.2 specs which is part of EE6, you will still find all of the general rules (from JSP.7.3 The Tag Library Descriptor onwards)

    Regards,
    Frits
     
    vipul bondugula
    Ranch Hand
    Posts: 222
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Frits Walraven wrote:

    If you check the JSP 2.2 specs which is part of EE6, you will still find all of the general rules (from JSP.7.3 The Tag Library Descriptor onwards)

    Regards,
    Frits


    I thought J2EE 6 has jsp 2.3 specification.Thanks Frits , for correcting me.
     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Saloon Keeper
    Pie
    Posts: 2449
    96
    Android Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I thought J2EE 6 has jsp 2.3 specification.Thanks Frits , for correcting me.

    No problem, I always use the following page:

    Java EE 6 Technologies

    Regards,
    Frits

     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic