• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

taglib's tagdir doubt  RSS feed

 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!