facebook

Unknown tag when using JSTL

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #237478 Reply

    pcleung
    Member

    I have put the following line on the top of the jsp

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

    but it keeps saying that

    Unknown tag <c:set>
    Unknown tag <c:out>

    #237524 Reply

    Scott Anderson
    Participant

    Did you create a MyEclipse Web Project?
    Did you add the JSTL libraries to it from the MyEclipse menu?
    You’ll need both for validation to work properly.

    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 can dig deeper if the above doesn’t fix it.

    #240283 Reply

    I am having the same problem. I noted in your response above that you have to add the JSTL libraries from the MyEclipse menu. I did not do that since the JSTL jars were part of the application already so I did not want to duplicate the jars. I have the JSTL jars that were supplied with the project in my build path. Do I need to do something else to get this to work?

    *** Date: Thu Oct 27 15:52:43 CDT 2005

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_04

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.0.3 GA
    Build id: 20051025-4.0.3-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Platform

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse RCP

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Java Development Tools

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Plug-in Development Environment

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse Project SDK

    Version: 3.1.0
    Build id: I20050627-1435

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    824_60
    -vm
    C:\Program Files\Java\jdk1.5.0_04\bin\javaw.exe

    #240288 Reply

    Riyad Kalla
    Member

    pwielard,
    Having the JARs there should be fine, can you expand the JAR listed in your package view named standard.jar, go into the META-INF dir, and open the c.tld file, then copy-paste the <uri></uri> line here for me to see? Then open a JSP that has an error marked in it and copy and paste the <%@taglib entries from it and put them here for me as well?

    #240291 Reply

    From the c.tld file in standard.jar:
    <uri>http://java.sun.com/jstl/core</uri&gt;
    From the jsp:
    <%@ taglib uri=”jstl-fmt” prefix=”fmt” %>
    <%@ taglib uri=”jstl-c” prefix=”c” %>
    <%@ taglib uri=”struts-html-el” prefix=”html” %>

    These uris are defined in web.xml and the tlds do exist in the taglib location directory.
    <taglib>
    <taglib-uri>jstl-c</taglib-uri>
    <taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>jstl-fmt</taglib-uri>
    <taglib-location>/WEB-INF/tld/fmt-rt.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>struts-html-el</taglib-uri>
    <taglib-location>/WEB-INF/tld/struts-html-el.tld</taglib-location>
    </taglib>

    I have also tried to change the uri in the jsp to be what is in the tld (http://java.sun.com/jstl/core) but I still get the warning that it is an unknown tag.

    Thanks.

    Paul Wielard

    #240293 Reply

    Riyad Kalla
    Member

    Paul,
    Can you try and restart using the -clean command line option, and then rebuild your project? If that doesn’t work please give me your Eclipse Build iD (Help > About) and MyEclipse Build ID (Window > Prefs > MyEclipse)

    #240321 Reply

    From the eclipse directory I ran ‘eclipse.exe -clean’ and then I ran the clean option under the Project menu which cleaned the project and then it did a build automatically. Unfortunately, I still get the Unknown Tag warning for all the jstl tags.

    Eclipse Build ID:
    Version: 3.1.0
    Build id: I20050627-1435

    MyEclipse Build ID:
    Version: 4.0.3 GA
    Build Id: 20051025-4.0.3-GA

    Thanks.

    Paul Wielard

    #240340 Reply

    Riyad Kalla
    Member

    Paul,
    Let’s try something silly here to make sure we are on the right track… try creating a new web project, be sure to select the correct J2EE spec level, then add the necessary JSTL libs to it, then drag and drop your project from the old project into the new one… did that work?

    #240609 Reply

    I tried it in a new project with one JSP copied over from project I am working. It works fine in the new project but not in the old one. I did some changes to make it closer to the old project like putting all tlds in a tld like the authors of the current project did. I am not sure what the difference is but the new small project works ok but the one that I am working on does not.

    Any ideas?

    Paul Wielard

    #240614 Reply

    Riyad Kalla
    Member

    Try removing the <Taglib> entries from your web.xml file and using the default URIs in your <%@ taglib entries… do tjhose pages validate alright? If you are still having trouble, rename your problom project to <name>-old, and create a new web project, just like it, called <name> and drag and drop the resources over a folder at a time, making sure they are validating correctly. This will either a) get you a new working project or b) let us know what it is that breaks it if you piecemeal the transition and make sure it is validating as you go, and then see where it breaks.

    It’s hard to say from here, what it could be, it could be many things, so I’m trying to get us on a track of self-diagnostic, hopefully the problem will reveal itself and we can stomp on it.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Unknown tag when using JSTL

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