Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Still TLD confusion

 
Rick Rangers
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm still having problems with the location and naming of .tld files.

My Deshmukh book tells me that if tld files are placed in a JAR file
it should be placed in a META-INF directory (or sub) and named taglib.tld.

In the specification I can't find this. When I read the specification I get the impression you can give the tld file any name you like when places in a JAR files as long as you place the tld file in the META-INF directory.

Is this assumtion correct?

Secondly: if you place a tld file in the WEB-INF or subdirectory, the container will automatically find it and if the tld file contains a <uri> element it will create a implicit mapping (given that the uri is unique)

Is my second assumtion correct?

I'm 13 hours away from my exam, so if someone could confirm my findings
of tell me otherwise it would be very appreciated!!

Regards,
Rick
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First question : you can give the TLD any name. A single TLD called "taglib.tld" was for the old specification 1.1.
Second question : yes, this is correct

I'm sorry to say that you have a very bad book. I've used the same one, and had to check the specs all the time.
Be really careful about tags and attributes, because they are not correct either. You've got to treat all tag related stuff really carefully.
 
Rick Rangers
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the clarification!

Yup, I think it's a bad book too. While using it
I've come to the conclusion that much of the info
is not up-to-date.. Head First next time
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic