Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Location of .tld file

 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
In head first, i have read that tld files must be inside WEB-INF/ or it's subdirectory. Or it must
be inside META-INF/ or it's subdirectory if it is bundled in jar. But when i move the same tld file
into application context directory and use taglib as follow-
<%@ taglib prefix="dyna" uri="/Test.tld"%>
It works fine.
How come rule to put tld into 'WEB-INF/ or it's subdirectory, META-INF/ or it's subdirectory' is broken and still things are fine.
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you are being sloppy. The URI should be defined inside the TLD itself and should them be used to match the TLD, not the file path. That's rather fragile.
 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am wondering why the JSP would still like to employee the Tag file after it has already had the Custom Tag class and EL function.
I am still poor in the Tag file part of the objectives while heading SCWCD.
 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Bibeault,
Thanks for your reply.
As per Head First, uri element is optional in '.tld' file. So if uri element is not mentioned in '.tld' file, then
uri attribute of taglib directive can take a path towards '.tld' file. But i was surprise to see it works fine even if '.tld'
file is NOT put into web_application_root/WEB-INF/ and IS PUT into web application root directory.
Thanks Zhixiong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic