aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Location of .tld file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Location of .tld file" Watch "Location of .tld file" New topic
Author

Location of .tld file

Sharmila Punde
Ranch Hand

Joined: Dec 26, 2007
Posts: 133
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


Regards, Sharmila.
We will have a future if we save Nature!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61596
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
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.


SCJP 1.4 SCJD
Sharmila Punde
Ranch Hand

Joined: Dec 26, 2007
Posts: 133
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Location of .tld file