• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Invalid TLD resource path

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic