• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

custom tags & tag handlers REVISITED

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, this topic is not new but so far I don't seem to get it working.
This is my .tld file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>templateTLD</short-name>
<uri>/tlds</uri>
<display-name>templateTLD</display-name>
<description>Template Tags</description>
<tag>
<name>insert</name>
<tagclass>com.mydomain.view.template.tags.InsertTag</tagclass>
<body-content>JSP</body-content>
<small-icon></small-icon>
<large-icon></large-icon>
<description>An insertion tag</description>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>String</type>
</attribute>
<attribute>
<name>template</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>String</type>
</attribute>
</tag>
</taglib>
AND here is JSP where I'm using this library
<%@ taglib uri="/templateTLD" prefix="template" %>
<template:insert template="/templates/sidedTemplate.jsp">

</template:insert>
There is an entry into web.xml reading :
<taglib>
<taglib-uri>/templateTLD</taglib-uri>
<taglib-location>/WEB-INF/tlds/barSidedTemplate.tld</taglib-location>
</taglib>
When invoking the JSP file, I get the following error:
Unable to load class com.mydomain.view.template.tags.InsertTag
barSidedTemplate.tld is sitting @ WEB-INF/tlds
InsertTag is under WEB-INF/classes/com/mydomain/servlets/view/template/tags
This is the package name: package com.mydomain.view.template.tags;
I am using JRun.
Any suggestions? Thanks in advance.
[ May 30, 2002: Message edited by: Erick Martinez ]
 
Erick Martin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Erick, try just placing your InsertTag into
WEB-INF/classes/com/mydomain/view/template/tags
it should work then.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think ur TagHandler class should be in
"WEB-INF/tld/com/mydomain/servlets/view/template/tags
"
instead of
"WEB-INF/classes/com/mydomain/servlets/view/template/tags
"
Try this out.
 
mustang india
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oops , I am sorry it should be
"WEB-INF/tld/com/mydomain/view/template/tags
"
 
mustang india
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,
I am really sorry. Eric is right.
Got confused with class file and tld file. Once again I apologise.
Mustang.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic