facebook

Custom JSP taglib problem: "could not load TLD for…&q

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #199524 Reply

    kaig1969
    Member

    I invoked New Project/J2EE/Web Module Project to create the project “myfrumple”. I specified frumple-Web/src as the Source Folder, and frumple-Web as the Web Root folder. I further specified frumple-Web as the context root.

    Then I went to the CVS explorer and told it to check out a repository into an existing project, and specified myfrumple/frumple-Web as the directory to check out into. It asked me whether to override the directory, I said yes.

    So far for the setup, now comes the problem: it can’t find my custom tag library. Here’s the story:

    I have a file myfrumple/frumple-Web/WEB-INF/tlds/frumple.tld which looks like this:

    <?xml version=”1.0″ encoding=”iso-8859-1″?>
    <!DOCTYPE taglib
    PUBLIC “-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN”
    http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd”&gt;

    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>fr</short-name>
    <uri>frumpletags</uri>

    <tag>
    <name>menuFrumple</name>
    <tag-class>some.valid.ClassName</tag-class>
    <body-content>empty</body-content>
    </tag>
    <tag>
    <name>outlookFrumple</name>
    <tag-class>another.valid.ClassName</tag-class>
    <body-content>empty</body-content>
    </tag>
    </taglib>

    My nifty O’Reilly JSP book tells me that the servlet container knows to look for *.tld files and then enables the taglibs specified therein. What’s more, it even works 😉 (I can start Tomcat using Ant and my own build.xml, and it finds the taglibs just fine.)

    But MyEclipse tells me it can’t find it. The Problems entry looks like this:

    could not load TLD for uri=evitatags, url=Y:/workspace/myfrumple/frumple-Webfrumpletags menu_header.jsp myfrumple/frumple-Web/jsp/include line 1 27. Oktober 2003 15:27:59

    What can I do?

    (The classes are amongst all the other classes that this web application uses; I’d rather not have to put them in a jar. It’s so much easier to grab the cherries^W^W^Wfind the bugs if it isn’t in a jar 😉

    Okay, and then there is this versions thing. I have Eclipse 3.0M4, MyEclipse 3.6.3 (? whatever was most current 1h ago), Tomcat 4.1.27 (not sure about the 27), and, err… ah, Windows 2k/pro.

    tia,
    Kai

    #199533 Reply

    support-michael
    Keymaster

    Can you post the following info:

    1) The taglib declaration from your jsp
    2) web.xml tag segment
    3) your .mymetadata file in the project root folder

    Michael
    MyEclipse Support

    #199535 Reply

    kaig1969
    Member

    The *.jsp file says this in the first line:

    <%@ taglib prefix=”fr” uri=”frumpletags” %>

    There is nothing about tag libraries in web.xml. I wanted to use the feature that the JSP container knows to search its root dir for *.tld files.

    The .mymetadata file is:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <project-module context-root=”/frumple-Web” name=”myfrumple”
    archive=”myfrumple.war” type=”WEB” id=”myeclipse.1067264247375″>
    <attributes>
    <attribute name=”webrootdir” value=”/frumple-Web”/>
    </attributes>
    </project-module>

    One more thing: I just see that the error message says “uri=evitatags”, that should be “uri=frumpletags”. I tried to remove all references to our product name, but missed one of them :-/

    I checked many times that the uri given in @taglib in the *.jsp is the same as the uri given in the *.tld file.

    Kai

    #199538 Reply

    support-michael
    Keymaster

    I understand your approach and need to research this on our end to determine if this is a bug or configuration issue. I know our test suite includes implicit taglib references with Jar files. Can you share your test project with me? If not, I’ll setup my own webproject that includes the src for a test taglib.

    Regards,

    Michael
    MyEclipse Support

    #199545 Reply

    kaig1969
    Member

    @support wrote:

    I understand your approach and need to research this on our end to determine if this is a bug or configuration issue.

    Oops, never thought it might be a bug.

    I know our test suite includes implicit taglib references with Jar files. Can you share your test project with me? If not, I’ll setup my own webproject that includes the src for a test taglib.

    I don’t have a test project, but I’ll make one. Silly me, should have thought of this at first.

    Kai

    #199550 Reply

    kaig1969
    Member

    I created a test project exhibiting the problem. Just visit the *.jsp file and you will see the error message.

    Telling MyEclipse to run this thing under Tomcat, using 4.1.27, works fine.

    http://www.emptydomain.de/kai/taglibtest.zip

    Kai

    #199555 Reply

    support-michael
    Keymaster

    Perfect, a fix was checked into our codebase yesterday on this very topic. I will test your app on the 2.6.3 and the new internal build. Thanks for your assistance and I’ll let you know what we determine. Also, we are planning a quick service patch to address this and a couple of other late JSP editor issues in the recent release.

    Michael
    MyEclipse Support

    #199573 Reply

    kaig1969
    Member

    Additional data item: if I specify the location of the *.tld file in <%@ taglib uri=…%>, then it works.

    I already need to specify the location of the *.tld file for Tomcat 4.1.18, so this is not a bad alternative.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Custom JSP taglib problem: "could not load TLD for…&q

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