If the container looks for tag files at some standard locations (Pg 499 HFSJ), why do we need to again specify the location in 'tagdir' attribute of 'taglib' directive? The only reason I can think of is a name conflict. Is there some other reason for this redundancy?
You've got to indicate in some way which tag file(s) you want to use in your page.
For tag files there may not be a tld so the container need to know which tag file you want to use ... you may have many tag files in the same directory so you've got to say which one you want ... hence the tagdir attribute.
SCJP 5.0 (preparing for SCWCD)
posted 10 years ago
When the location of tag files is already standardized i.e WEB-INF/tags or WEB-INF/tags/moreTags etc, whats the point in again giving the same path in tag dir?
Also even If I give tagdir='WEB_INF/someDir', it wont look for tags in that folder right? So I don't see the use of giving a tagdir at all. But why is it mandatory?
I've wondered myself as it does seem unnecessary and redundant. Perhaps at one time in the formulation of the Spec, more than one location was proposed and this is a remnant of an incomplete scaling-back decision.