facebook

problems with custom tag library content assist [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #210395 Reply

    mrasmussen
    Member

    I cannot get content assist to work for any tag libraries except <jsp:
    I have the tld’s for the libraries and they show up in green instead of red, so my eclipse is finding them, but I can’t get them to show up in the content assist. Do I need to add them to a preference somewhere?. This is not so much a bug as confusion.

    #210534 Reply

    Scott Anderson
    Participant

    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 that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.

    #210546 Reply

    Riyad Kalla
    Member

    Have you defined the TLDs in your web.xml file? Do you have the class files for the TLDs in your classpath?

    #210575 Reply

    mrasmussen
    Member

    What operating system and version are you running?

    Win XP

    What Eclipse version and build id are you using? (Help > About Eclipse Platform)

    3.0 Final

    – Was Eclipse freshly installed for MyEclipse?

    Yes

    – If not, was it upgraded to its current version using the update manager?
    NA

    – Are any other external plugins installed?

    viPlugin, XmlBuddy
    – How many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.*

    8

    What MyEclipse version are you using? (Help > About Eclipse Platform > Features)

    3.8b2

    What JDK version are you using to run Eclipse? (java -version)

    1.4

    What JDK version are you using to launch your application server?

    1.4

    What steps did you take that resulted in the issue?

    Tried to use the jstl core library
    What application server are you using?

    tomcat 4.1

    Are there any exceptions in the Eclipse log file? (<workspace>/.metadata/.log)

    no

    Have you defined the TLDs in your web.xml file?

    No

    Do you have the class files for the TLDs in your classpath?

    Yes.

    The problem is not that I cannot get the TLD’s recognized. They do not show up in red, they just don’t have the auto complete like jsp:. Is it required to have the actual class files for MyEclipse to do auto complete? Seems like all it should need is a tld. Also my web.xml file is not in the derectory I am working in. For my particular setup, web.xml is a generated file.

    #210586 Reply

    Riyad Kalla
    Member

    JSP Editor must have a TLD file for autocomplete, BUT it must either be defined in your web.xml file in the <taglib> section (that’s what that is for) or in the META-INF directory of a JAR file that is in your classpath (much like the struts.jar does it).

    #210801 Reply

    mrasmussen
    Member

    So, as an example i have the struts.jar on my project’s classpath, and I have the line
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %> in my jsp. However, I do not get auto complete for the <tiles: tags. The don’t even show up in the auto complete window if I use ctrl+space

    #210811 Reply

    No Operation
    Member

    try this one:

    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>

    NOP

    #210828 Reply

    Riyad Kalla
    Member

    mrasmussen,
    The problem here is that the Struts JAR file contains its own URIs for Struts (which is what NOP used above), unless you define a new URI for the taglib in your web.xml file using <taglib> tags, you must use the URI defined by the Struts tags.

    Also its important to note that the URI is a idenitfier, not a locator. The URI you are using above is an absolute path to the taglib, but this is not what is needed, you have to use its identifier, which by default is something like “http://jakarta.apache.org/struts/tags-tiles&#8221; (this changes depending on taglib, and Struts release).

    #210908 Reply

    mrasmussen
    Member

    I tried using the uri from above and got nothing. Also, what identifier would I use fro a custom library? It doesn’t have a uri anywhere?

    #210916 Reply

    Riyad Kalla
    Member

    I tried using the uri from above and got nothing.

    What version of Struts are you using? Is it from MyEclipse or did you download a nightly build yourself and install it into your webapp? The URIs have changed with the newer struts releases, that’s why I ask.

    Also, what identifier would I use fro a custom library? It doesn’t have a uri anywhere?

    You define whatever you want, just make sure you point at the right file, for example:

    web.xml

    
    <taglib>
        <taglib-uri>/tags/user-tags</taglib-uri>
        <taglib-location>/WEB-INF/custom-user-tags.tld</taglib-location>
    </taglib>
    

    MyJsp.jsp: import tag

    <%@ taglib prefix="user" uri="/tags/user-tags" %>

    MyJsp.jsp: use tag

    
    <body>
    ...
        <user:name />
    ...
    </body>
    

    Did that help?

    #210919 Reply

    mrasmussen
    Member

    Tahnks for the help. I’m pretty busy right now, but I will give it a try this afternoon.

    #210921 Reply

    Riyad Kalla
    Member

    No problem, let us know if it works.

    #211026 Reply

    mrasmussen
    Member

    I actually don’t know what changed, I didn’t add anyting to my web.xml file, but everything is working as it should now. I got a newer release of our custom jar, but I don’t know what changed. Even the struts stuff works now.
    Thanks,
    Michael

    #211034 Reply

    Riyad Kalla
    Member

    Michael,
    Hey I’m glad everything is working, let us know if anything else pops up.

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: problems with custom tag library content assist [Closed]

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