facebook

[Closed] File "/WEB-INF/struts-html.tld" not found

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

    Robin Clark
    Member

    I am getting the above error in my index.jsp. My web.xml looks like this:

    
    <!-- Struts Tag Library Descriptors -->
      <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
    
      <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
    
      <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
    
      <taglib>
        <taglib-uri>/tags/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
    
      <taglib>
        <taglib-uri>/tags/struts-tiles</taglib-uri>
        <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
      </taglib>
    
    

    My index.jsp has the following:

    
    
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    
    

    My web app directory structure is as follows:

    WebRoot
    ->WEB-INF
    ->->struts-html.tld
    ->->struts-logic.tld
    ->->tags
    ->->->struts-html.tld
    ->->->struts-logic.tld

    Note that I have struts-html.tld and struts-logic.tld under BOTH WEB-INF and WEB-INF/tags but they are still not being found.

    When I start my application server and execute the application, I receive the following error:

    
    
      /index.jsp(1): Error in using tag library uri='/tags/struts-html' prefix='html': The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'name', (JSP 1.1 spec, 5.4.1)
    probably occurred due to an error in /index.jsp line 1:
    <%@ taglib uri="/tags/struts-html" prefix="html" %>    
    
    

    If I use the following code in my index.jsp the application works fine:

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

    Can someone explain to me why I am having troubles accessing the tld files locally?

    Thank you.

    #259551 Reply

    skvishwa
    Member

    I think you need to use matching .TLD file with corresponding .jar file from Struts, because all the classes used in .TLD files are in .jar file, you will get this type of error if classes referred in TLDs are not matching in JAR.

    -Sanjay

    #259580 Reply

    Robin Clark
    Member

    Thanks Sanjay! With your help I have learned that it is of upmost importance that you use all the same versions of the struts files. They are not mix and match!

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: [Closed] File "/WEB-INF/struts-html.tld" not found

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