• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tag Lib

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whilr trying to execute a JSP with simple TagLib, I get the status 500 error saying "Unable to load tag handler class".I am using tomcat 5.0.28.
TLD file is :
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd">

<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>test</short-name>
<uri>http://www.manning.com/scwcd</uri>;
<tag>
<name>required</name>
<tag-class>sampleLib.RequiredTag</tag-class>
<body-content>empty</body-content>
<description>Prints * wherever it occurs</description>
</tag>
</taglib>

Do i need to put some entry in web.xml for the Taglib/tag java class ?
I have put the jstl.jar in test/web-inf/lib folder. I made the lib folder inside the web-inf.have i put the jstl.jar in the corrrect position
Thanks,
Rishi
[ November 05, 2005: Message edited by: Rishi google ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rishi,

Make following entries in your application deployment descriptor (web.xml) and try again reloading the application. (From your tld file, It seems you are using J2EE 1.3)

<taglib>
<taglib-uri>myTaglib</taglib-uri>
<tablig-location>WEB-INF/myTLD.tld</taglib-location>
</taglib>

Alankar Yannam
 
Alankar Yannam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rishi,

Correction to my previous posting.
1. Replace value in <taglib-uri> element with value in <uri> element in your tld file.
2. Replace "myTld.tld" with your tld file name.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rishi,

You have to have standard.jar also into you WEB-INF/lib directory. You can get from jsp-examples/WEB-INF/lib directory of tomcat.

SAM..
 
Rishi M
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I tried adding:
<taglib>
<taglib-uri>sampleLib</taglib-uri>
<tablib-location>/WEB-INF/sampleLib.tld</taglib-location>
</taglib>

in the web.xml.
IN the sampleLib.tld I have samplelib in the <uri>
but now i start getting the error:
HTTP Status 404 - /test/requiredTest.jsp

--------------------------------------------------------------------------------

type Status report

message /test/requiredTest.jsp

description The requested resource (/test/requiredTest.jsp) is not available.

The same code is working fine in WSAD 5.1.1 without writing the <taglib> in web.xml.

I am trying this code from the Deshmukh book.when i copied the code folder in webapps it worked OK, but on trying to make the similar code in a new folder I am getting the above error.
I have added standard.jar in lib.It was not present in the sample code of Heamant Desmukh CD.
Please let me know what else can be tried.
Thanks,
Rishi
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
As you mentioned that you are trying to make the similar code work in a different folder , please check if the package structure mentioned below matches the folder that you have organised your class files inside WEB-INF.

<tag-class>sampleLib.RequiredTag</tag-class>

Correct me if my pointer is wrong.

Thanks
Sethu Prem
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you find the solution!?? What was it?
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rishi,

Sethu's reply sounds to be correct.I also stress the same.Check whether RequiredTag class is there under WEB-INF/classes/sampleLib.

Get back if error persists.

Regards,
Priya.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic