- This topic has 10 replies, 5 voices, and was last updated 21 years ago by Panagiotis Korros.
-
AuthorPosts
-
bufordMembercould not load TLD for uri=/eforms-taglib.tld, url=D:/Dummy/Devel/IDE/eclipse/workspace/myeclipse/Web Root/eforms-taglib.tld
The file exists and my web.xml has the taglib defined in it.
I get this when I click on ‘Recompile All JSPs”.
Here is my tag:
<%@ taglib uri=”/eforms-taglib.tld” prefix=”eforms” %>Any help would be greatly appreciated.
johnsonaMemberI had a similar problem. To fix it, I created a WEB-INF/dtd directory and dropped web-jsptaglibrary_1_1.dtd into it, then edited my tld to point to that instead of to the one on Sun’s website. Worth a shot. Might be a better way of fixing it, though.
support-michaelKeymasterFrom the info you provided your TLD file must reside under the WEB-INF directory or 1 of its subdirectors excluding WEB-INF/lib and WEB-INF/classes.
Option-1:
The simplest recovery action is to move the eforms-taglib.tld directly under WEB-INF and reference it from the uri attribute of your JSP taglib directive.<%@ taglib prefix=”eforms” uri=”/WEB-INF/eforms-taglib.tld” %>
Option-2:
If you already have a taglibrary entry in your web.xml or want the level of indirection it provides then do something like this:In your web.xml file:
<taglib>
<taglib-uri>/lovely_eforms_tags</taglib-uri>
<taglib-location>/WEB-INF/eforms-taglib.tld</taglib-location>
</taglib>then modify the taglib directive in your JSP page as follows:
<%@ taglib prefix=”eforms” uri=”/lovely_myeforms_tags” %>
I hope this helps.
Michael
MyEclipse Support
bufordMemberThanks for your suggestion ! It worked very lovely. 😆
DeanJonesMemberThanks, this was driving me loopy too…
bufordMemberHi, just a quick observation. It seems MyEclipse works with either of those two options mentioned above, but if I specify a path that’s relative to the webroot but not under /WEB-INF, it didn’t work.
For example, suppose I have:
/webroot/
/webroot/WEB-INF/
/webroot/suite/styles/taglibs/taglib.tldIf I try
<%@ taglib prefix=”eforms” uri=”/suite/styles/taglibs/taglib.tld” %>
It won’t work. It seems it must be under /WEB-INF. Is this a bug ?
Thanks
support-michaelKeymasterNo, this is not a bug. The JSP spec, section 7.3.2 states that TLD files reside under the WEB-INF directory.
The TLD resource path is interpreted relative to the root of the web
application and should resolve to a TLD file directly, or to a JAR file that has a TLD file at location META-INF/taglib.tld. If the TLD resource path is not one of these two cases, a fatal translation error will occur.Michael
MyEclipse Support
bufordMemberThanks Michael, but isn’t the /suite directory in my example above “relative to the root of the web application” ? I always thought the root of the web application was webroot, not WEB-INF. I’m reading the spec now and I see what you’re talking about though. Thanks
support-michaelKeymasterSeems that the spec quote doesn’t support my assertion that TDL’s reside under the WEB-INF folder. I’ll research this futher and follow up ASAP.
Michael
MyEclipse Support
support-michaelKeymasterOK. I knew I had read this in the spec before but was slow to locate it in a previous response. The following quote if from JSP1.2 spec, Section 7.3.1.
Tag library descriptor files have names that use the extension “.tld”, and the extension indicates a tag library descriptor file. When deployed inside a JAR file, the tag library descriptor files must be in the META-INF directory, or a subdirectory of it. When deployed directly into a web application, the tag library descriptor files must always be in the WEB-INF directory, or some subdirectory of it.
Michael
MyEclipse Support
Panagiotis KorrosMemberI think there is a bug in My Eclipse and that this topic should not be marked as closed.
I get the following error:’could not load TLD for uri=/WEB-INF/custom.tld, url=/WEB-INF/custom.tld’
when Custom tld is located directly under ‘/WEB-INF’
My web.xml includes the section:
<taglib>
<taglib-uri>/WEB-INF/custom.tld</taglib-uri>
<taglib-location>/WEB-INF/custom.tld</taglib-location>
</taglib>If i place custom.tld under ‘/WEB-INF/tld’ and change web.xml to :
<taglib>
<taglib-uri>/WEB-INF/custom.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/custom.tld</taglib-location>
</taglib>Everything works ok.
I am using Eclipse 3.0 m4 and my eclipse 3.6.4.
-
AuthorPosts