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

problem with running Classic tags

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have written a classic tag handler (to be honest copied) and tried to invoke that in jsp.but this is what i'm getting

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 8 in the jsp file: /customtag1.jsp
Generated servlet error:
classic1 cannot be resolved to a type

An error occurred at line: 8 in the jsp file: /customtag1.jsp
Generated servlet error:
classic1 cannot be resolved to a type

An error occurred at line: 8 in the jsp file: /customtag1.jsp
Generated servlet error:
classic1 cannot be resolved to a type


Here is my jsp:
<%@ taglib prefix="ss" uri="/WEB-INF/mytld.tld" %>
<html>
<head>
</head>
<body>
<ss:sstag>
<%
out.println(" hai inside the jsp...");
%>
</ss:sstag>
</body>
</html>

and my tld is
<?xml version="1.0" encoding="UTF-8"?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
web-jsptaglibrary_2_0.xsd" version="2.0">
<tlib-version>1.0</tlib-version>

<tag>
<name>sstag</name>
<tagclass>classic1</tagclass>
<body-content>JSP </body-content>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>

</taglib>

and the tag class is compiled and placed in WEB-INF/classes.
where am i getting it wrong?
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your tld file is incomplete check tld below and see where you have made mistakes.
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dude,
i have changed the tagclass into tag-class and put the uri tag(this not mandatory as a matter of fact).but still i'm getting the same exception.
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to package your classic tag handler and change value for <tag-class>.
Ex :<tag-class>tags.Classic1</tag-class> if Classic1.java is present in WEB-INF/classes/tags folder.
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Value of <uri> tag should match with attribute uri of taglib directive.
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no it resides in the the dafault package.And i tried the uri thing.And also <taglib> specification in DD.both are giveing the same exception
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Whenever you work with TagHandler follow the packaging convention.put your class under anyone package like tags.Classic1.java...then use page directive to import this class.

<%@ page import="tags.Classic1" %>
 
It's a tiny ad only because the water is so cold.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic