Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about tld

 
Kiril Nugmanov
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

In HFS there is a question about tld files:
Which is true about TLD files?
(A) TLD files may be placed in any subdirectory of WEB-INF.
(B) TLD files are used to configure JSP environment attributes, such as scripting-invalid.
(C) TLD files may be placed in the META-INF directory of WAR file.
(D) TLD files can declare both Simple and Classic tags, but TLD files are NOT used to declare Tag Files.

Correct answer is: A.

But as I know it cant be placed in to WEB-INF/classes directory or it states that ok it can be placed but won't work?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TLD files should not be placed in /WEB-INF/classes or /WEB-INF/lib. It's not "must not", it's "should not", but I agree with you. I would not have answered A either. I would have rephrased it like :
(A) TLD files may be placed in any subdirectory of WEB-INF, except the "classes" and "lib" subdirectories.
 
Kiril Nugmanov
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe.

Will contnue my jorney to the SCWCD5
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TLD Files can be placed in the following locations.
a) Directly within WEB_INF.
b) Under any subdirectory within WEB-INF. WEB-INF/*
c) Under META-INF inside a JAR file which is placed under WEB-INF/lib.
So for example if i have a jar file tags.jar then it must be placed under
WEB-INF/lib and therefore the tld can be placed under
WEB-INF/lib/tags.jar/META-INF
c) Under any subdirectory under META-INF inside a JAR file which is placed under WEB-INF/lib.
WEB-INF/lib/tags.jar/META-INF/*
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
b) Under any subdirectory within WEB-INF. WEB-INF/*

Please check JSP.7.3.1 Identifying Tag Library Descriptors.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:

Please check JSP.7.3.1 Identifying Tag Library Descriptors.


yes, i read it Christophe. but, i check that just placing the tld in /WEB-INF/lib/.tld file ...it is working well. what do you say about this ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i check that just placing the tld in /WEB-INF/lib/.tld file ...it is working well.

The spec says that you should not place them there. It means that it may work, and the container you are using is fine with that. But it's not guaranteed for all containers. Otherwise the spec would not mention it at all.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:
But it's not guaranteed for all containers. Otherwise the spec would not mention it at all.


yes,got it.Thanks Christophe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic