- This topic has 2 replies, 2 voices, and was last updated 18 years, 7 months ago by
Robin Clark.
-
AuthorPosts
-
Robin ClarkMemberI 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.tldNote 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.
skvishwaMemberI 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
Robin ClarkMemberThanks 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!
-
AuthorPosts