File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Invalid TLD resource path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Invalid TLD resource path " Watch "Invalid TLD resource path " New topic
Author

Invalid TLD resource path

Venkatesh Kumar
Ranch Hand

Joined: Aug 08, 2003
Posts: 68
Hi All;

I am trying to deploy a struts appl using Jboss app server,and am getting the following error ---

java.lang.IllegalArgumentException: Invalid TLD resource path /WEB-INF/struts-logic.tld

I have placed the tlds in -- myproject/src/web-inf/struts-logic.tld

My web.xml looks like--
<taglib>
<taglib-uri>struts-logic.tld</taglib-uri>
<taglib-location>struts-logic.tld</taglib-location>
</taglib>

and the the taglib directive in the jsp page looks like --------

<%@ taglib uri="struts-logic.tld" prefix="logic" %>

Can anyone please tell me where I am going wrong.I have also placed struts-bean.tld and struts-html.tld in the same dir structure.Why is it not showing exceptions for the other tld files refrenced in the jsp page.

Thanks
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

see u have placed the tlds in web-inf but u have not properly configured that path in web.xml ....the xml now (with what u have written says that tld is directly under ur project) so change it

<taglib>
<taglib-uri>struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

and by the way if u use struts 1.1 there is no need to make an entry in web.xml too .just place the tlds under web-inf and directly use that in jsp
Venkatesh Kumar
Ranch Hand

Joined: Aug 08, 2003
Posts: 68
Hi Sreenath:

Thanks for the response.I have modified my web.xml and the jsp page as you said.Now the web.xml and jsp page looks like as follows:
jsp page
-----------
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="html" %>
web.xml
------------
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

similarly the struts-html,and struts-logic are defined .As I said before the dir structure is as follows :
myproject/src/WEB-INF/struts-bean.tld
myproject/src/WEB-INF/struts-logic.tld
myproject/src/WEB-INF/struts-html.tld

I still keep getting the exception which says invalid TLD resource path.can anyone tell me where I am going wrong .

Thanks
John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
I have the same except my taglib are contained by <jsp-config></jsp-config> tags, I'm not sure if they're necessary or not but it works fine for me.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Venkatesh Kumar:
I still keep getting the exception which says invalid TLD resource path.can anyone tell me where I am going wrong .
Take the error message seriously. Your TLDs aren't where you say they are. The paths you give are in a directory called src; are the tlds in the deployed web application?

By the way, there was no need to change your taglib URIs. They are just identifiers and have nothing to do with the physical location of the TLDs. They can be anything. BUT. The Struts taglibs have a default URI, such as http://jakarta.apache.org/struts/tags-bean for the bean taglib; just look near the top of the TLD file. I would strongly suggest you use these standard URIs. In fact, your TLDs should automatically be mapped to these URIs by the container without you having to specify anything in web.xml (see JSP.7.3.4ff in the JSP specification)! This feature can be temperamental, though, and hasn't always worked for me. Still it's worth a try, less work to do is always good

- Peter
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by John Smith:
I have the same except my taglib are contained by <jsp-config></jsp-config> tags, I'm not sure if they're necessary or not but it works fine for me.
This is because you have a Servlet 2.4 / JSP 2.0 deployment descriptor, while VK probably has a Servlet 2.3 / JSP 1.2 deployment descriptor.

- Peter
Venkatesh Kumar
Ranch Hand

Joined: Aug 08, 2003
Posts: 68
Hi All:

I still cound not resolve the exception "Invalid TLD resource path".Also when i was going through one of the tutorials I came across the following statement --
"In JBoss, the tag_library_name.tld must be located in the /WEB-INF/lib pathway in order to be located by the JBoss engine. "

I have also tried doing the above !!!Is the above statement true ???The taglib location looks simple but have not been able to go past the above problem...
G Powlos
Greenhorn

Joined: Sep 15, 2004
Posts: 1
Hi Venky,

I noticed something in your code.

---
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="html" %>
---

Seems like there might be a conflict while Struts tries to figure out which prefix to map the TLD to....

Hope that works.
Cheers!
 
Consider Paul's rocket mass heater.
 
subject: Invalid TLD resource path
 
Similar Threads
"WEB-INF/lib/struts-html.tld" not Found
Struts taglibs - references - doubt
How to user Struts Tags in a WebApplication
Why: File "/WEB-INF/struts-html.tld" not found.
"/tags/struts-logic" not found