facebook

taglib issue in web project. [Closed]

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

    beasys
    Member

    Hello,

    This is related to other taglib issues people have had earlier in this posts. Basically I use weblogic 81 in my project and in my web.xml i have entries which define taglib as :

    <taglib>
    <taglib-uri>render.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/render_taglib.jar</taglib-location>
    </taglib>

    Now, in the render_taglib.jar file, there is a taglib.tld within the META-INF directory, which maps to the tags defined in render.tld. Now my page renders just fine in the browser, weblogic seems to know how to apply the correct mapping. But the eclipse workbench seems to throw an error. I can correct the error if I create a new file called “render.tld” (which is a copy of the taglib.tld) and put it in the jar file along with the original “taglib.tld”. However I have about fifty such jar’s in my lib, and these are generated by the build. So it’ll be a major pain to change them everytime somebody updates those taglibs.

    Would it be possible for the eclipse workbench to do the same mapping as weblogic does to get the taglibs ? That’ll solve a huge problem, because if not, the only feature workbench feature I’ll be able to use is jsp syntax coloring 🙂

    Thanks,
    Jalpesh.

    #201865 Reply

    support-michael
    Keymaster

    MyEclipse was tested on a configuration similar to what you describe, e.g., WebWork, and code completion works according to the JSP spec. Can you please provide the following info:

    1) describe your configuration
    http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=394

    2) check your Eclipse error log for errors, see <Eclipse install dir>/workspace/.metadata/.log

    Michael
    MyEclipse Support [/url]

    #201920 Reply

    beasys
    Member

    Sorry about not putting my configuration information earlier :

    I am using Eclipse M6, and just downloaded the latest Workbench (I think it’s 2.7) which works on M6. The jdk I use is 1.4.1, and I run on Windows XP machine. It was a fresh install, I deleted the entire eclipse directory, reinstalled eclipse and then installed workbench. I am using weblogic 8.1 as my app server.

    The error I get on the jsp (In the problems view) is :

    cannot load tld for “render.tld” uri = “WEB-INF/lib/render_taglib.jar”.

    Also, there is no eclipse log created.

    Please let me know if you need more information. I’ll be very happy if this is just a configuration issue and eclipse does support this notion.

    Thanks,
    Jalpesh.

    #201962 Reply

    support-michael
    Keymaster

    I ran a few more test cases based on the scenario you describe and do not experience any abnormal problems. I’m working with the packaged version of WebWork. If you’re interested I can send you my example project to diff w/ your project? If you’re interest just send me an email address at support@genuitec.com.

    Michael
    MyEclipse Support

    #201980 Reply

    No Operation
    Member

    what version is your web.xml?

    
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    

    do not use 2.4, it is not yet supported!

    NOP

    #202000 Reply

    beasys
    Member

    My web.xml is 2.3 :

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

    As I had mentioned before, my render_taglib.jar contains a file called taglib.tld in the META-INF directory. Now, if I renamed the file to be called render.tld, the compilation from myeclipse goes fine. I think that the way weblogic works if you add an entry like this in your web.xml :

    <taglib>
    <taglib-uri>render.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/render_taglib.jar</taglib-location>
    </taglib>

    in your web.xml, it first tries to find render.tld in the render_taglib.jar, if it does not find that file, it probably defaults to a taglib.tld. (I haven’t read the specs, so I am not sure what j2ee standard says) However Myeclipse probably tries to find the file render.tld in the render_taglib.jar and if it does not find it, it throws an error.

    My email would be jpatadia@yahoo.com so if Michael, you can send me the example project, I can take a look at it.

    Thanks,
    Jalpesh.

    #202003 Reply

    No Operation
    Member

    … so I tested:
    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
     <taglib>
       <taglib-uri>render.tld</taglib-uri>
        <taglib-location>/WEB-INF/lib/render_taglib.jar</taglib-location>
      </taglib>   
    </web-app>
    

    taglib.tld

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
            PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
        "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
      <tlib-version>1.0</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>render</short-name>
      <uri>render-uri</uri>
      <display-name>Test</display-name>
      <tag>
        <name>page</name>
        <tag-class>test.Render</tag-class>
        <body-content>JSP</body-content>
      </tag>
    </taglib>
    

    Java file: Render.java

    package test;
    import javax.servlet.jsp.tagext.TagSupport;
    public class Render extends TagSupport 
    {
    }
    

    placed Render.class and taglib.tld into render_taglib.jar

    + test
              + Render.class
    + META-INF
              + taglib.tld
    

    created a simple JSP page:

    <%@ taglib prefix="render" uri="render.tld" %>
    <render:page/>
    

    and it works fine…

    some comments:

    … it first tries to find render.tld in the render_taglib.jar, if it does not find that file, it probably defaults to a taglib.tld.

    This is not correct. If there is a specified mapping in the web.xml, the mapping MUST be used, and the file taglib.tld MUST exist in the JAR.

    I prefer to use the original URIs, so I avoid to specify stuff in the web.xml

    NOP

    #202009 Reply

    beasys
    Member

    That’s interesting, I’m still getting the error in my original webapp.

    But I think there is something else which is wrong in my webapp configuration, because I created a new webapp wtih just one entry in its web.xml (copied from the original web.xml) pointing to the render_taglib.jar.

    When I created sample.jsp which had a taglib uri pointing to the render taglib, the jsp compiled fine, and code completion to that taglib also worked like a charm.

    Hmmmm, I think there is something else which is wrong with my webapp which is causing this issue. I’d love to send it to the support@genuitec.com but it’s about 35 megs in size 🙂

    NOP, I am very sorry to take so much time of your time in trying to solve this issue. I will try and dig into my webapp to see if I can find what’s causing this error to appear. If you have any pointers in what could be causing it, I would appreciate if you’d told them to me.

    #202018 Reply

    Riyad Kalla
    Member

    beasys

    I’m going to close this issue, but if you find a particular problem or test case by all means let us know and we’ll reopen it and investigate.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: taglib issue in web project. [Closed]

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