facebook

taglib – EL – JSP 2.0

💡
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 Archived
  2.  > 
  3. Bugs
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #235540 Reply

    pdenti
    Member

    I think that what follows is a myeclipse bug. I found it when defining custom functions in el / jsp 2.0

    You can reproduce it in the following way:
    class with 2 methods:

    package tst;
    
    public class EL1 {
        
        public static boolean a() { return true; }
        public static boolean b(javax.servlet.http.HttpSession session) { return true; }
    }
    

    tld with 2 custom functions:

    <?xml version="1.0" encoding="UTF-8" ?>
    
    <taglib 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-jsptaglibrary_2_0.xsd"
        version="2.0">
        
        <description>test</description>
        <display-name>test</display-name>
        <tlib-version>1.0</tlib-version>
        <short-name>test</short-name>
        <uri>http://test/jsp/jstl/test</uri>
        
        <function>
            <name>a</name>
            <function-class>tst.EL1</function-class>
            <function-signature>boolean a()</function-signature>
        </function>
        
        <function>
            <name>b</name>
            <function-class>tst.EL1</function-class>
            <function-signature>boolean b(javax.servlet.http.HttpSession)</function-signature>
        </function>
        
    </taglib>
    

    jsp using both methods:

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="test" uri="http://test/jsp/jstl/test" %>
    <html>
        <body>
        test JSP page.<br/>
        <c:if test="${test:a()}">a true</c:if>
        <c:if test="${test:b(pageContext.session)}">b true</c:if>
        </body>
    </html>
    

    In this case you get a myeclipse compile error, in the first row of jsp, saying that the method b in class EL1 does not exist. note that the application, when deployed, works perfectly.
    If you split the class EL1 into two classes

    package tst;
    public class EL1 {
        
        public static boolean a() { return true; }
    }
    package tst;
    public class EL2 {
        
        public static boolean b(javax.servlet.http.HttpSession session) { return true; }
    }
    

    and change the taglib definition

        ...
        <function>
            <name>b</name>
            <function-class>tst.EL2</function-class>
            <function-signature>boolean b(javax.servlet.http.HttpSession)</function-signature>
        </function>
        ...
    

    the compile error disappears

    note that the problem appears only if you have parameters in method signature; if you have two methods like

    public static boolean a()
    public static boolean b()

    everything works well

    regards
    Paolo Denti

    p.s. i am using eclipse 3.1 final, myeclipse 4.0M2, jdk 1.5.0_04, windows xp pro sp2

    #235574

    Riyad Kalla
    Member

    Paolo,
    In your TLD above you have a tlib version of 1.0, shouldn’t that be 2.0?

    Also I have filed your issue and we are looking into this. If this turns out to be a bigger issue with the JSP parsing it may have to wait for our 5.0 release.

    #235594

    pdenti
    Member

    @support-rkalla wrote:

    Paolo,
    In your TLD above you have a tlib version of 1.0, shouldn’t that be 2.0?

    Also I have filed your issue and we are looking into this. If this turns out to be a bigger issue with the JSP parsing it may have to wait for our 5.0 release.

    Thanks for the reply. in the meanwhile i found a solution to the problem that could be a help for you.
    A friend of mine, with a similar configuration, working on the same project, did not have that problem. the only difference was that i installed optional eclipse components (visual editor, uml2.0, emf, gef, …)
    I deleted the old eclipse installation, installed it from scratch without installing emf, gef, …, installed myeclipse 4.0M3.
    after launching eclipse, the problem remained: i saw a “red cross” on the jsp file. I did a “clean project” and the “red cross” disappeared. now it looks it is working. hope this can help.

    btw you are right, probably the tld version should be 2.0 but it was not related to the problem.

    #235602

    Riyad Kalla
    Member

    I am glad the problem is fixed for the time being, it is very possible that your custom installs of those supporting libraries effected MyEclipse as we rely quite heavily on those libraries. We are upgrading the versions included in MyEclipse for 4.0 so you shouldn’t need to install them separately to get VE to work after 4.0 comes out.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: taglib – EL – JSP 2.0

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