File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why: File "/WEB-INF/struts-html.tld" not found.

 
Robin Clark
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the above error in my index.jsp. My web.xml looks like this:



My index.jsp has the following:


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:



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



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

Thank you.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The latest versions of Struts (1.2.9 and above) in fact do not support a name attribute in the <html:form> tag. It has been deprecated. This means there's nothing wrong with your tag library declarations. You just need to remove the name and type attributes from your <html:form> tag.
 
Vikrant Korde
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We were also facing the same problem.
The solution to this is to use correct version of the.tld file.

Compare the file
/WEB-INF/struts-html.tld
and the file present in struts.jar \META-INF\tlds\struts-html.tld

There must be some differences between these 2 files.

The reason it was working for 2nd code, is because when you put http://struts.apache.org/tags-html then it takes the tld from the JAR file directly. and in previous case it takes from web-inf directory.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic