facebook

Can’t load JSTL TLD in Resin 3.0.8 [Closed]

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

    partitura
    Member

    I’ve been looking at other posts regarding this topic, and most relate to struts. In any case, I can’t seem to solve it.

    I’m using MyEclipseIDE 3.8beta1 on Mac OS X with Eclipse 3.0. My server is Resin 3.07.

    At the top of one of my JSP pages, I declare the taglib like this:
    <%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core %>
    <%@ taglib prefix=”fmt” uri=”http://java.sun.com/jstl/fmt %>

    My eclipse gives me the little red X next to first of these declarations saying “could not load TLD for uri=http://java.sun.com/jstl/core”.

    Its curious that it does this for the first taglib declaration only, and not the second. If I remove the first, then it shows on the second.

    In any case, I have tried a number of things to solve this, with no luck. I imported the resin jstl jar into the build path, but that did not help. I tried a jstl 1.1 TLD that I found on the web, and referencing that TLD through the web.xml, but it was referencing the apache classes (not resin), and that didn’t work.

    When I war up my webapp and deploy it, it works correctly on Resin.

    Any ideas to make myeclipse work with jstl?

    #210616 Reply

    Riyad Kalla
    Member

    Originally were you using the JSTL 1.0 libraries that are added via the “Add JSTL Libraries” feature in MyEclipse? Did you have anything defined in your web.xml file?

    Also can you try upgrading to Beta 2 of MyEclipse 3.8, it seems like in the back of my head we fixed some taglib bugs, but I could be wrong. I know that I’ve helped someone with Beta 2 and JSTL and it works.

    #213966 Reply

    jaynes
    Member

    I just downloaded and installed MyEclipse. I too use Resin 3.0.8 and have the same problem with the JSTL taglibs. Resin implements JSTL itself, so I don’t want to include any JSTL libs or tlds in my project. A collegue of mine extracted the JSTL tlds from the resin.jar and added them to his project and was able to get things working that way, but I’m not willing to do that.

    So how can the MyEclipse JSTL support work with Resin?

    #213970 Reply

    Riyad Kalla
    Member

    jaynes,
    Just add the Resin JSTL JARs to your BUild Path by way of the “Add External JAR” mechanism, and then use the default URIs in your pages. ME will resolve the URIs from the JARs and walla, all set.

    Note that the URI changed between JSTL 1.0 and 1.1, so be sure to use the right one (quick way to do this, open the TLD file and look for the <uri> tag at the top).

    #213979 Reply

    jaynes
    Member

    Still problems. I’ve added both the resin.jar and the jstl-11.jar that comes with resin to the project build path. I’ve checked that my uri in the jsp taglib line is “http://java.sun.com/jsp/jstl/core&#8221;, the same as in the TLD file. I still get the following validation error.

    File “http://java.sun.com/jsp/jstl/core&#8221; not found. NOTE: No JSP line number was avaliable so line 1 was used for the marker. first.jsp

    Will

    #213986 Reply

    Riyad Kalla
    Member

    Will,
    The JSTL TLDs are actually in the standard.jar file, you need to add that too.

    #213992 Reply

    jaynes
    Member

    Riyad,

    No, sorry, but there is no standard.jar in the resin3.0.8/lib directory. The TLD files are in the resin.jar. The resin.jar is on the project build path, but ME doesn’t find them there.

    Will

    #213995 Reply

    Riyad Kalla
    Member

    No, sorry, but there is no standard.jar in the resin3.0.8/lib directory.

    My mistake, I was going off of the Sun JSTL download; I don’t have Resin installed locally to test this out.

    The resin.jar is on the project build path, but ME doesn’t find them there.

    Can you paste a small sample page here for me that I can use to replicate this locally and optionally attach it to a bug report?

    #214004 Reply

    jaynes
    Member

    There’s hardly a need for a sample page. But one is below. The error occurs right on the taglib line. The page below runs fine in Resin, with no JSTL jars or TLD files in the WEB-INF of a web app.

    The TLD files are in the resin.jar file. But ME can’t find them there. I suspect that it is because the TLD files are located in com/caucho/jstl. Where is ME looking for these files? I even tried extracting the TLD files and jaring them up in their own jar file and adding that jar to the build path. ME still can’t find the TLDs.

    ——————-
    <%@ taglib uri=”http://java.sun.com/jsp/jstl/core&#8221; prefix=”c” %>

    <html>
    <head>
    </head>
    <title>My Title</title>
    <body>
    Nothing on this page.
    </body>
    </html>

    #214007 Reply

    Riyad Kalla
    Member

    jaynes,
    Thank you for the sample I was able to reproduce this problem after download Resin and working with it. I did change the URI to use the one from the resin’s TLD file, however this still didn’t work. I have filed a high priority bug with a test project attached and I hope we can get this fix rolled otu to you soon.

    #214011 Reply

    Riyad Kalla
    Member

    jaynes,
    It turns out that according to web application spec, the only valid location for TLD files in a JAR files is under the META-INF directory:

    JSP.7.3.1 Identifying Tag Library Descriptors
    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. TLD files should not be placed in /WEB-INF/classes or
    /WEB-INF/lib.

    You can work around this by creating a JSTL user library and adding it to your project, this can use the JSTL version that we ship with ME or maybe something you download from Sun separately. That way you will get compile-time resolution.

    Resin, since they implement their own tags and such, have probably implemented their class loaded to scan the entire Resin.jar file for the TLDs, which is why you have no problem when you deploy this.

    #214047 Reply

    jaynes
    Member

    OK, I’m not quite there yet, but am closer. I have put the resin tld files into a jar. In the jar the files are under META-INF, so it complies with the JSP spec. I’ve added this jstl-tld.jar file to the build path, along with the resin.jar and the resin jstl-11.jar.

    My validation now works fine. All my jsp pages pass validation without errors. However, the autocompletion for JSP does not work. How can the validation pass and yet the autocompletion fail?

    Will

    #214061 Reply

    jaynes
    Member

    In order to get Resin out from this discussion I have done the following. I got rid of all the references to the resin specific jars. I downloaded the Sun jstl.jar and standard.jar and put them on the build path. Again, validation works but autocompletion does not. So this isn’t a resin thing.

    Will

    #214078 Reply

    Riyad Kalla
    Member

    Will,
    We currently don’t support JSTL 1.1, just JSTL 1.0 (which is what Resin seems to ship with anyway) you can get this by right clicking on your project and “Adding JSTL capabilities”, then make sure you are using the correct URIs for the taglibs and it should work… I just did this locally and it worked as expected:

    
    <%@ page language="java" import="java.util.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
      </head>
      <body>
        <c:choose></c:choose> <!-- working autocomplete -->
      </body>
    </html>
    

    JSTL 1.1 support should be comming in the 3.8.2 or 3.8.3 release, sorry for the delay.

    #214086 Reply

    jaynes
    Member

    Riyad,
    Here’s my problem with your suggestion of using MyEclipse to “Add JSTL Libs”. It adds lots of libraries and tld files that my project doesn’t need at runtime. MyEclipse shouldn’t require that I add all that stuff to my project in order for JSTL autocompletion to work.

    At least I have JSTL validation working. It doesn’t make sense that autocompletion doesn’t work.

    If the ME JSTL 1.1 support also requires that all those files be added to my project, then it isn’t going to be what I need.

    Will

Viewing 15 posts - 1 through 15 (of 18 total)
Reply To: Can’t load JSTL TLD in Resin 3.0.8 [Closed]

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