facebook

[Closed] "Uknown tag" error on tiles:useAttribute

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

    rtulloh
    Member

    I am running MyEclipse 5.0.1. I am seeing warnings about Unknown tag from a tiles: statements that looks like this:

    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>

    <tiles:useAttribute name=”title” classname=”java.lang.String” scope=”request” />

    The 2nd line is colored in yellow and shows as a warning.
    All references to the attribute title are then flagged as errrors (unresolved attribute).

    The only thing I can put my finger on is that somehow MyEclipse is unable to find the struts-tiles.tld file, but I don’t know why. The Project Capabilities->Struts 1.2 tab shows the strutes-tiles.tld file in the path. The only thing special about this particular project is that there are 2 WEB-INF directories in the source (these get combined at build time by ant). I point MyEclipse at one of these 2 directories so it can find struts-config.xml. Could this somehow be involved? My project is a legacy project so I cannot change the structure of it. What else could be going on to cause this warning and error?

    Also, I was hoping that when 5.0.x came out, there would somehow be a way to put my TLD files into projects on a per-project basis. Maybe there is someway to do that? The Project properties->MyEclipse->Web has a Tag Librarites tab, but this tab only lets you configure bindings.

    Thanks in advance for any help.

    #257035 Reply

    Riyad Kalla
    Member

    One of two things is happening… 1 is that your taglib URI is just wrong, please read this: http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-10906.html

    The second, is that you have multiple WEB-INF dirs, MyEclipse only looks at the one under your WebRoot dir (whatever it’s called). Also please note in the FAQ entry above how URIs are resolved by JAR contents as well.

    #257070 Reply

    rtulloh
    Member

    I should have mentioned in my original post that I had already ruled out web.xml. It has the proper taglib mappings defined. So, I suspect the issue is somehow related to multiple WEB-INF dirs.

    Is there any way to configure MyEclipse to consider multiple locations? Maybe I just need to work around this by copying all the needed files to the place where MyEclipse is configured to look. Not ideal, but it may be a workaround.

    #257116 Reply

    Riyad Kalla
    Member

    Well as I mentioned the WEB-INF dir it’s looking at is the one under whatever directory you have marked as your WebRoot directory. So as long as that dir contains your TLDs (since you use custom mappings) you should be OK.

    #257824 Reply

    Win2003, Eclipse 3.2.0, MyEclipse 5.0.1

    #257825 Reply

    Win2003, Eclipse 3.2.0, MyEclipse 5.0.1.

    I see the same problem reported by others for MyEclipse 5.0.1. I was not having this problem with MyEclipse 4.x. Your answers continue to focus on the misinterpretation of URIs and web.xml, but as far as I can tell, my configuration should be correct. In particular my JSP file has:

    <%@ taglib uri=”/WEB-INF/struts-html.tld” prefix=”html” %>
    ….
    <html:html>

    and <html:html> is not recognized anymore.

    My project webroot folder is /docroot.

    Under /docroot/WEB-INF, I have web.xml and struts-html.tld.

    web.xml contains the following:
    <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>

    So what’s wrong?

    Thank you.

    #257830 Reply

    Riyad Kalla
    Member

    Warren,
    Thank you for the detailed post, in your particular case you are correct that all seems fine. I just created a project with the structure you mention and everything seems fine, can you download it from here and impor it into yout workspace and see if it works?

    #257836 Reply

    Many thanks for the response. After importing your project into my workspace, with your jsp file, I do not get the taglib warnings, and autocomplete works by entering something like <http:Ctrl-Space.

    In my project, I adjusted virtually everything that did not exactly match from your project settings and in the various files under your directories, but I still cannot get the taglibs to apparently be recognized when editing my jsp files.

    I finally noted that my project had a .settings directory under it containing the following files:
    com.genuitec.eclipse.core.prefs
    com.genuitec.eclipse.j2eedt.core.prefs
    com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs
    org.eclipse.jdt.ui.prefs
    org.eclipse.ltk.core.refactoring.prefs
    org.eclipse.wst.validation.prefs

    When I copied the .settings directory under your project, I can reproduce the taglib problem.

    The com.genuitec.eclipse.j2eedt.core.prefs and org.eclipse.wst.validation.prefs files look most suspicious, containing the following.

    #Tue Aug 29 17:50:56 EDT 2006
    defaultTldInfo=http\://java.sun.com/jsp/jstl/core\=c;http\://java.sun.com/jsp/jstl/sql\=sql;html\=http\://struts.apache.org/tags-html;c\=http\://java.sun.com/jsp/jstl/core;fmt\=http\://java.sun.com/jsp/jstl/fmt;h\=http\://java.sun.com/jsf/html;nested\=http\://struts.apache.org/tags-nested;http\://struts.apache.org/tags-html\=html;http\://java.sun.com/jsp/jstl/fmt\=fmt;bean\=http\://struts.apache.org/tags-bean;http\://java.sun.com/jsp/jstl/functions\=fn;fn\=http\://java.sun.com/jsp/jstl/functions;logic\=http\://struts.apache.org/tags-logic;http\://struts.apache.org/tags-nested\=nested;http\://java.sun.com/jsp/jstl/xml\=x;tiles\=http\://struts.apache.org/tags-tiles;f\=http\://java.sun.com/jsf/core;http\://java.sun.com/jsf/html\=h;http\://struts.apache.org/tags-tiles\=tiles;http\://java.sun.com/jsf/core\=f;http\://struts.apache.org/tags-bean\=bean;x\=http\://java.sun.com/jsp/jstl/xml;sql\=http\://java.sun.com/jsp/jstl/sql;http\://struts.apache.org/tags-logic\=logic
    eclipse.preferences.version=1
    useProjectTldPrefs=true

    #Tue Aug 29 17:51:24 EDT 2006
    DELEGATES_PREFERENCE=delegateValidatorList
    USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;com.genuitec.eclipse.javascript.validation.JavaScriptValidator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;
    USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;com.genuitec.eclipse.javascript.validation.JavaScriptValidator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;
    USER_PREFERENCE=overrideGlobalPreferencesfalse
    eclipse.preferences.version=1

    Indeed, if I remove these two files, things work.

    Any thoughts on how this and the other .settings file were originally created, and recommendations on what to do with them when upgrading from MyEclipse 4.x to 5.x?

    #257839 Reply

    Riyad Kalla
    Member

    The .settings directory is the eclipse standard way of storing Project-specific settings. (like compilers, formatters, etc.). I suppose you could always erase the dir and re-create it, all the important build-path information is stored in your .classpath and .project files, so you won’t loose anything critical, maybe just some minor tweaks.

    #257921 Reply

    Have you tested with Struts 1.2? I am continuing to have problems even after removing the .settings from my project. In particular:

    1. If I put the following in my jsp:
    <%@ taglib uri=”http://struts.apache.org/tags-bean&#8221; prefix=”bean” %>
    validation is ok, and I can autocomplete <bean:

    2. If I put the following in my jsp:
    <%@ taglib uri=”http://struts.apache.org/tags-bean&#8221; prefix=”bean” %>
    And define the following in my /WEB-INF/web.xml file:
    <taglib>
    <taglib-uri>http://struts.apache.org/tags-bean</taglib-uri&gt;
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    validation is ok, and I can autocomplete <bean:

    3. If I put the following in my jsp:
    <%@ taglib uri=”http://struts.apache.org/tags-bean2&#8243; prefix=”bean” %>
    And define the following in my /WEB-INF/web.xml file:
    <taglib>
    <taglib-uri>http://struts.apache.org/tags-bean2</taglib-uri&gt;
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    validation is –not– ok, and I cannot autocomplete <bean:

    Any theories?

    #257934 Reply

    Riyad Kalla
    Member

    I cannot reproduce this:

    And here is my project. Double check that I did what you were asking about correctly please. Maybe I missed some detail.

    #257940 Reply

    Your project works fine. Mine does not. How may I provide my zipped project to you?

    #257943 Reply

    I finally found the significant difference that causes the problem. If the web.xml file has the following extra taglib definition, the problem occurs:

    <jsp-config>
    <taglib>
    <taglib-uri>/struts</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts.jar</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://struts.apache.org/tags-bean2</taglib-uri&gt;
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    </jsp-config>

    This did not cause a problem under MyEclipse 4.x.

    #257947 Reply

    Riyad Kalla
    Member

    I’m not sure why/how this is valid:

    
    <taglib>
    <taglib-uri>/struts</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts.jar</taglib-location>
    </taglib> 
    

    What is this snippet of code trying to say?

    #257949 Reply

    I have no idea. I obviously am removing this (unless I subsequently find some issue with it). Regardless, perhaps you can suggest why it would have caused problems with the recognition of the other taglibs and/or request a fix to MyEclipse if it is considered a bug rather than end-user configuration issue.

Viewing 15 posts - 1 through 15 (of 16 total)
Reply To: [Closed] "Uknown tag" error on tiles:useAttribute

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