| Author |
taglib's tagdir doubt
|
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14669
|
|
About the tagdir attribute in the taglib directive, the spec says : Indicates this prefix is to be used to identify tag extensions installed in the /WEB-INF/tags/ directory or a subdirectory. An implicit tag library descriptor is used (see Section JSP.8.4 for details). A translation error must occur if the value does not start with /WEB-INF/tags/. A translation error must occur if the value does not point to a directory that exists. A translation error must occur if used in conjunction with the uri attribute. I've tried to declare the prefix with : <%@ taglib tagdir="/WEB-INF/tags" prefix="tag" %> It does not start with "/WEB-INF/tags/", but I can successfully use my custom tag. (under Tomcat). Can anybody explain this ?
|
[My Blog]
All roads lead to JavaRanch
|
 |
Cai DongShan
Ranch Hand
Joined: Dec 07, 2004
Posts: 102
|
|
I don't find the message you mentioned in the JSP 8.4. In JSP 8.4, it only talks about the location of tag file. Did you get it from spec file jsp-2_0-fr-spec.pdf. The samples inside the spec also use tagdir="/WEB-INF/tags".
|
Best Regards,<br />DongShan<br /> <br />SCJP1.4, SCWCD1.4
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14669
|
|
Cai, thank you for the reply. Yes, same spec, 2.0. I am referring to JSP.1.10.2 The taglib Directive, Table JSP.1-9. The section you are referring to is about the tag and its descriptor (implicit/explicit). I am asking about the taglib directive in JSP.
|
 |
Shivani Chandna
Ranch Hand
Joined: Sep 18, 2004
Posts: 380
|
|
Hello Satou , When it is states -
A translation error must occur if the value does not start with /WEB-INF/tags/
Here it is talking of the tagdir attribute - and not prefix! Try putting some other path - for tagdir other than /WEB-INF/tags and you will get an error . Regards
|
/** Code speaks louder than words */
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14669
|
|
Hello Shivani,
Here it is talking of the tagdir attribute - and not prefix!
Yes, I agree. As I mentionned in my first post, that's why I tried to set the tagdir to something not starting with "/WEB-INF/tags/" : <%@ taglib tagdir="/WEB-INF/tags" prefix="tag" %> But it works fine.
|
 |
Shivani Chandna
Ranch Hand
Joined: Sep 18, 2004
Posts: 380
|
|
Satou, Well....So you are distinguishing between /WEB-INF/tags and /WEB-INF/tags/ - Right ....? Hmm....It seems the interpretation of /WEB-INF/tags is the same as /WEB-INF/tags/ Regards.
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14669
|
|
Well....So you are distinguishing between /WEB-INF/tags and /WEB-INF/tags/ - Right ....?
Yes. That makes a big difference to me Saying starting with "a/b" and starting with "a/b/" sounds different to me. If somebody could try it with another container like websphere.
|
 |
 |
|
|
subject: taglib's tagdir doubt
|
|
|