This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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?
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.
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/*
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.