facebook

JSTL tags not recognized

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    ernestz
    Member

    I am using ME 6.0.1 and testing facelets support, utilizing .XHTML files and have included a reference to the JSTL tag library.

    I’m using the MyEclipse Visual JSF Designer and if I enter <c: and hit the CTRL-SPACE, the autocompletion prompts for “catch”, “forEach”, “if” and “set”, nothing else. If I enter <c:choose>, <c:when>, and <c:otherwise>, the tags are marked as an error “Unknown element”, but the pages deploy and render correctly.

    These tags are available in the Palette (JSTL Core), but these tags are still not recognized. Is there something else I have to do to get this autocompletion to work, or at least, not flagged as an error?

    Installation details:

    *** Date: 
    Monday, November 12, 2007 10:48:26 AM CST
    
    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_11
    
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710
    
    
    *** Eclipse details:
    MyEclipse Enterprise Workbench
    
    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710
    
    
    
    
    Eclipse Graphical Editing Framework
    
    Version: 3.3.1.v20070814
    Build id: 20070814-1555
    
    
    Eclipse Platform
    
    Version: 3.3.1.R33x_r20070911-_19UEkpF-B7Uh2hKy75y
    Build id: M20070921-1145
    
    
    Eclipse RCP
    
    Version: 3.3.1.R33x_r20070802-8y8eE8sEV3Fz0z0GlHJrXvTAUS
    Build id: M20070921-1145
    
    
    Eclipse Java Development Tools
    
    Version: 3.3.1.r331_v20070629-7o7jE72EDlXAbqAcnbmyg1rf8RIL
    Build id: M20070921-1145
    
    
    Eclipse Plug-in Development Environment
    
    Version: 3.3.1.R33x_r20070802-7N7M3D1VIA_52JsDFsEC
    Build id: M20070921-1145
    
    
    Eclipse Project SDK
    
    Version: 3.3.1.R33x_r20070802-7M7J78_mu1mnlRa7A4Ns52XeZ6D0
    Build id: M20070921-1145
    
    
    
    
    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe
    -name
    Eclipse
    --launcher.library
    C:\Program Files\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll
    -startup
    C:\Program Files\MyEclipse 6.0\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
    -vm
    C:\usr\jre1.5.0\bin\client\jvm.dll
    
    
    #278468

    Loyal Water
    Member

    When you created your project, did you add JSTL support to it on the first page of wizard ?

    Add this at the top of your page :-

    
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
    

    Let me know if the problem persists.

    #278507

    ernestz
    Member

    Yes, JSTL and ICEfaces Facelets support was added when the project was created.

    I am using .XHTML files for Facelets support, so the taglib directive is not valid. I do have the following at the start of the .XHTML pages:

    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">

    If I enter “<c:” and hit CTRL-SPACE, a popup appears with only a subset of the core tags, and <c:choose>, <c:when>, <c:otherwise> are not among those tags. If I expand the Palette control, I do see these tags there. But, whether I manually enter these tags, or select from the Palette, the Visual JSF designer flags those as errors.

    #278604

    Loyal Water
    Member

    You need to add xmlns:x=”http://java.sun.com/jstl/xml&#8221;

    
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:x="http://java.sun.com/jstl/xml"
        xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en"
        >
    

    You can drag and drop these elements from the palette. They are under JSTL XML.

    #278619

    ernestz
    Member

    Adding the “xmlns:x” has no effect.

    I was hoping to use c:choose/c:when/c:otherwise to keep from having to insert several c:if statements.

    Inserting the c:choose,c:next,c:otherwise tags works correctly when deployed, it is just that ME’s visual JSF designer flags them as errors.

    I guess I will have just ignore the false errors.

    #278843

    Riyad Kalla
    Member

    Guys sorry for the confusion, the reason for this is that Facelets actually implements a *subset* of the JSTL library in it’s own Facelets-specific-taglib manner, please see this:
    https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-available-jstl

    to stay in sync with official Facelets, we just support what is declared in the doc. I’m honestly surprised when deployed, the undefined tags work…

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: JSTL tags not recognized

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