facebook

Jakarta JSTL not recognized [Closed]

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

    JSP files that include the following taglib tag
    <%@ taglib uri=”http://java.sun.com/jstl/core&#8221; prefix=”c” %>
    and were recognized by MyEclipse 2.8 now do not appear to be working on Eclipse 3.8.1.

    jstl.jar and standard.jar are included in the project classpath.

    Activating WebProject capabilities did not help and was not easy to remove.

    I will appreciate any help.

    Yuval

    #215007 Reply

    Riyad Kalla
    Member

    Yuval we need a bit more information from you. The Build IDs of Eclipse (Help > About) and MyEclipse (Window > Prefs > MyEclipse) as well as any errors from the log file that you see.

    Also what do you mean “are not recognized” you mean they give you build errors (left margin), reconciler errors (right margin) or no autocomplete?

    #215097 Reply

    Thanks for the response. These are the versions:
    Eclipse version: Version: 3.0.0, Build id: 200406251208
    MyEclipse: 3.8.1+QF20040825
    Build Id: 200408201200-3.8.1+QF20040825

    The errors are reconciler errors: yellow underline, right margin markers, and there is no autocomplete.

    Yuval

    #215102 Reply

    Riyad Kalla
    Member

    Yuval,
    Can you find the standard.jar file that is added to your build path in the package view, expand it, and go into the META-INF dir and open the core.tld file, near the top you will see some <uri></uri> tags… what is the string of text between them?

    Also please open your web.xml file and see if you haev any <taglib> entries that are mapping the JSTL tags to some other URI.

    #215105 Reply

    Riyad,

    I do not have a core.tld file inside my META-INF directory.
    I do have a c.tld file with the following URI:
    http://java.sun.com/jstl/core

    I am using Jakarta Taglibs 1.0.5 for standard.jar and jstl.jar

    I have no <taglib> entries in web.xml.

    Hope this helps you diagnose the problem.

    Yuval

    #215125 Reply

    Riyad Kalla
    Member

    Yuval,
    I cannot reproduce this:

    I am using the Jakarta Standard tags v 1.0.5 from here: http://mirrors.xtria.com/apache/jakarta/taglibs/standard-1.0/binaries/jakarta-taglibs-standard-1.0.5.zip

    Steps to Reproduce

      1) Create new Web Module Project, check the “Add JSTL libs” and hit Finish.
      2) Edit java build path and remove standard.jar and jstl.jar
      3) Unzip the taglibs from the link above, copy over the standard.jar and jstl.jar files into the project, say “Yes” to overwrite confirmation.
      4) Create new page with contents below and save/validate it:
      File Contents:

      
      <%@ page language="java" %>
      <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> 
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
        <head>
          <title>My JSP 'MyJsp.jsp' starting page</title>
        </head>
        <body>
          <c:out value="dog" />
        </body>
      </html>
      

    Also I expanded the JARs to make sure they were the org.apache packages and not the Sun ones.

    Please try the steps I’ve outlined and see if you can get that to work.

    #215683 Reply

    Ted Burns
    Member

    Riyad,
    Are you saying the JSTL1.0 devilered with 3.8.1 is bad ?
    Thanks

    #215684 Reply

    Riyad Kalla
    Member

    ted,
    no I was only trying to reproduce the problem the user above was experiencing when using the Jakarta libs.

    #215792 Reply

    Ted Burns
    Member

    I’am having the same problem!

    #215796 Reply

    Riyad Kalla
    Member

    ted,
    What problem? If you mean the problem outlined in this thread, then did you try all the steps I outlined *exactly* as I typed them? What was the result?

    Can you please post all the information we request in the [URL=http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-393.html]Posting Guidelines[/URL] thread at the top of this forum? That will give us some context so that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.

    #215907 Reply

    Ted Burns
    Member

    Riyad,

    Operating system and version: Win2000 5.00.2195 SP4
    Eclipse version and build id: 3.1.0 200408122000
    Eclipse freshly installed
    No other external plugins installed.
    Number of plugins in the <eclipse>/plugins directory like org.eclipse.pde.*: 7
    MyEclipse version: 3.8.1+QF20040825
    JDK version used to run Eclipse: 1.4.2-b28
    JDK version used to launch your application server: Same

    Steps did you taken that resulted in the issue:
    New project and add JSTL libs as above

    Application server: Tomcat 5.0.28

    I created a project from scratch as you did above.
    JSP Validator complained http://java.sun.com/jsp/jstl/core could not be found.
    via the following line in MyJsp.jsp:
    <%@ taglib uri=”http://java.sun.com/jsp/jstl/core&#8221; prefix=”c”%>

    So I added the following to the web.xml:

    <jsp-config>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri&gt;
    <taglib-location>lib/standard.jar</taglib-location>
    </taglib>
    </jsp-config>

    Then JSP Validator complained it could not find the META-INF/taglibs.tld file in the standard.jar file. This file is the 1.0.5 version of the JSTL 1.0 lib. Looking inside I could not find the META-INF/taglibs.tld, there was however a “META-INF/permittedTaglibs.tld” file. I renamed this file to “META-INF/taglibs.tld” and the the JSP Validator stopped complaining, all was fine.

    So my question to “support” is Why is the JSP Validator looking for a filename “META-INF/taglibs.tld” in the WEB-INF/lib/*.jar’s when Apaches JSTL 1.0 is placing a file named “META-INF/permittedTaglibs.tld” in the standard.jar release. One reason may be that the JSP Spec states it will look for the “META-INF/taglibs.tld” file. So either ME needs to change the JSP Validator to look for “META-INF/permittedTaglibs.tld” in the WEB-INF/lib/*.jar’s or Apache needs to follow the Spec. A work around is to modify the standard.jar file as noted above, however I not sure this is appropriate, or correct.

    Your Thoughts …

    Ted

    #215910 Reply

    Riyad Kalla
    Member

    Ted,
    First let me thank you for all the information, second there are quite a few things wrong with the information you gave that I hope will help us track down whats going on.

    Eclipse version and build id: 3.1.0 200408122000

    MyEclipse is officially supported on Eclipse 3.0.0, but users are seemingly having no problems with 3.0.1. We don’t support 3.1 at all and it isn’t due out until next year. Wether this effects us or not in this situation is hard to say, I’m just letting you know this pretty much makes support from our end impossible with trickier problems (we’ll try and help with the basic things we recognize).

    JSP Validator complained http://java.sun.com/jsp/jstl/core could not be found.
    via the following line in MyJsp.jsp:
    <%@ taglib uri=”http://java.sun.com/jsp/jstl/core&#8221; prefix=”c”%>

    If you added JSTL libs using MyEclipse, then you are using the wrong URI. The URI for JSTL 1.0 is:

    http://java.sun.com/jstl/core

    You can verify this yourself by creating a new project and adding JSTL (assuming you haven’t changed the libs yourself) and opening the standard.jar/META-INF/c.tld file

    So I added the following to the web.xml:

    <jsp-config>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri&gt;
    <taglib-location>lib/standard.jar</taglib-location>
    </taglib>
    </jsp-config>

    AFAIK you cannot give JARs as locations for TLD files. ME and your application server will search your JARs/META-INF directories anyway for TLD files; its part of the spec for TLD URI resolution. Besides that, paths in web.xml are relative from the root, so this path should be /WEB-INF/lib/standard.jar (but I still believe this is not supported).

    Then JSP Validator complained it could not find the META-INF/taglibs.tld file in the standard.jar file.

    Not surprised…

    Looking inside I could not find the META-INF/taglibs.tld, there was however a “META-INF/permittedTaglibs.tld” file. I renamed this file to “META-INF/taglibs.tld” and the the JSP Validator stopped complaining, all was fine.

    If you take a look at my post with the screenshot you can see that I was using the Jakarta impl of JSTL without any changes or problems, due to some mistakes above I believe you are munging the project and the libs even farther and ultimately it probably won’t work correctly until the previous issues are cleared up.

    I’m actually a little surprised, all of this information I thought was clear in my post above and you can see the URI and test page I was using in my screenshot… if you follow these steps *exactly* you should be fine. I think the biggest problem here was the incorrect URI making you think that what you had was broken when in fact it was probably fine.

    So my question to “support” is Why is the JSP Validator looking for a filename “META-INF/taglibs.tld” in the WEB-INF/lib/*.jar’s

    I’m betting this is just a generic error while its trying to resolve the TLD files, not a literal error.

    #215913 Reply

    Ted Burns
    Member

    Riyad,

    Well…. daaah. I truly got lost in the fog. Didn’t realise the URI was wrong. Don’t remember where I cut and paste that from. And it is good to know you folks only support 3.0.0 not 3.1.0. By the way, 3.0.1 worked with the correct URI and all original JSTL files. Thanks for all your help.

    Ted

    #215914 Reply

    Riyad Kalla
    Member

    Ted,
    I’m glad its working now… its always the little things isn’t it? 😛

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: Jakarta JSTL not recognized [Closed]

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