facebook

JSTL compilation problem [Closed]

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

    rob.antici
    Member

    – System Setup ——————————-
    Operating System and version: win2k
    Eclipse version: 2.1.1
    Eclipse build id: 200306271545
    MyEclipse version: 2.7RC2
    Eclipse JDK version: 1.4
    Application Server JDK version: using weblogic 8.1, jdk 1.4

    – Message Body ——————————-
    I have a simple JSP using JSTL
    I include the core JSTL library, <%@taglib uri=”http://java.sun.com/jstl/core&#8221; prefix=”c” %>

    I then have this simple statement: The user info from the browser is: <c:out value=”${header[‘User-Agent’]}” default=”unknown”/>

    Weblogic runs the JSP just fine but MyEclipse is reporting this error on the task list. “unknown user tag <c:out… check http://java.sun.com/jstl/core

    I’m sure there must be a good reason for this, as everyone using JSTL can’t be putting up with these kind of errors.

    thanks

    #202473 Reply

    Riyad Kalla
    Member

    Did you put entries in your web.xml file for these taglibs? (In the mean time I’m downloading the JSTL libs to try this out)

    #202474 Reply

    Riyad Kalla
    Member

    Rob,
    I just tried this setup and everything worked fine. The only difference is that I’m using Eclipse 2.1.2 GTK on Linux and JDK 1.4.2_03

    #202492 Reply

    rob.antici
    Member

    I had my taglib location set to WEB-INF/lib/standard.jar which contains c.tld.
    This didn’t work, I guess I need to specify the .tld specifically? When I made the change I did get
    rid of the error.

    thanks

    #202621 Reply

    support-michael
    Keymaster

    We have a test project similar to what you describe. You should not have to add the taglib entry to your web.xml file or explicitly include the c.tld in your project if it includes the packaged version of the JSTL core taglib, i.e.g., <web-root>/WEB-INF/lib/standard.jar. There was a PR on this for the RC1-2 releases that has been addressed in the upcoming release. Until the next release on occasion when adding a packaged taglib (a jar) to your project you may need to recycle ME to get it to reload the packaged taglibs since they are currently cached when the project is 1st opened for performance reasons.

    #202626 Reply

    Riyad Kalla
    Member

    Michael,
    w.r.t. to reloading TLDs, is there a PR for the next release to perform a reload on a taglib when the TLD is saved? (i.e. actively being developed?). Currently people need to close/reopen their project for it to reload.

    #202659 Reply

    support-michael
    Keymaster

    Yes, there is a fix in the current development code stream to clear the internal TLD and code cache for changes to TLD, web.xml, and jar files. This feature will be in the next release.

    #202675 Reply

    No Operation
    Member

    off topic:

    <c:out value=”${header[User-Agent’]}” …

    and

    <!DOCTYPE web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/dtd/web-app_2_3.dtd”&gt;

    means that you try to use EL-Expressions with JSP 1.2.

    For more information look into jsp-2_0-fr-spec.pdf, Table JSP.3-1 EL Evaluation Settings for JSP Pages:
    EL: Ignored if web.xml <= 2.3
    so the web.xml should look like this:

    
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://
      java.sun.com/xml/ns/j2ee/web-app_2_4.xsd” version=”2.4”>
    ...
    

    NOP

    #202677 Reply

    Riyad Kalla
    Member

    Yes you are quite right, thank you for pointing out the error.

    #203028 Reply

    deskenny
    Member

    I’m having a different problem with JSTL/JSPs within MyEclipse.

    I’m getting a

    “Error javax/servlet/jsp/JspContext”

    whenever I try and use any of the JSTL tags. They all actually work when I access the deployed page, so the standard.jar, web.xml are all fine.

    The error appears if I enter any “${header[‘User-Agent’]}” type entries

    <c:choose>
    <c:when test=”${index%2==1}”>
    <tr bgcolor=#FFFFCE>
    </c:when>
    <c:otherwise>
    <tr bgcolor=#FFFFFF>
    </c:otherwise>
    </c:choose>

    Functions correctly, but shows an error within MyEclipse jsp editor

    I’ve tried mimicing the deployment described earlier in this post, but the same error results

    Anyone come across anything similar?

    cheers

    P.S. I’m using Eclipse Version: 2.1.2
    Build id: 200311030802 under WindowsXP, JRE 1.4.1_01, Tomcat 5.0

    P.P.S MyEclipse has made life much much easier compared to Lomboz/Sysdeo plugins

    #203029 Reply

    deskenny
    Member

    Turns out I was using a bum version of JSTL. Started using “standard-1.0” with JRE 1.4.2 and all is fine. No need to make web.xml changes, just dropped the correct version of standard.jar into the WEB-INF/lib dir.

    Works well

    #203031 Reply

    Riyad Kalla
    Member

    Thanks for following up with this thread with us, we are glad its working for you.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: JSTL compilation problem [Closed]

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