• 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

Exact location of ".tld"

 
Ranch Hand
Posts: 48
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 924
1
Netbeans IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
     
    Ranch Hand
    Posts: 253
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    Posts: 3411
    320
    Android Eclipse IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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 John
    Ranch Hand
    Posts: 253
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    Posts: 3411
    320
    Android Eclipse IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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

     
    reply
      Bookmark Topic Watch Topic
    • New Topic