facebook

Could not load TLD for URI [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #199926 Reply

    buford
    Member

    could 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.

    #199932 Reply

    johnsona
    Member

    I 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.

    #199934 Reply

    support-michael
    Keymaster

    From 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

    #199953 Reply

    buford
    Member

    Thanks for your suggestion ! It worked very lovely. 😆

    #199971 Reply

    DeanJones
    Member

    Thanks, this was driving me loopy too…

    #199985 Reply

    buford
    Member

    Hi, 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.tld

    If 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

    #199986 Reply

    support-michael
    Keymaster

    No, 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

    #199989 Reply

    buford
    Member

    Thanks 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

    #199993 Reply

    support-michael
    Keymaster

    Seems 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

    #200109 Reply

    support-michael
    Keymaster

    OK. 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

    #200116 Reply

    I 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.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: Could not load TLD for URI [Closed]

You must be logged in to post in the forum log in