File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Custom tags Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom tags Problem" Watch "Custom tags Problem" New topic

Custom tags Problem

saravana.T kumar

Joined: Jul 13, 2007
Posts: 23
I am having an error with tomcat which says
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 11 in the jsp file: /hi.jsp
test2 cannot be resolved to a type
9: <%@ taglib prefix="my" uri="dog" %>
11: <my:dimple/>
13: </body>
My TLD file (simple.tld) is(placed in /web-inf dir)

<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns=""

My class file (in web-inf/classes dir)

My jsp file (root)


<%@ taglib prefix="my" uri="dog" %>



I cant get this thing working . Please help.

[BPSouther: Added code tags]
[ August 31, 2007: Message edited by: Ben Souther ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Firstly, you should be following convetional naming standards. Classes should being with a capital letter. As in Test2.

Secondly, place your class in a package other than the default. See the JSP FAQ for more information on this.

[Asking smart questions] [About Bear] [Books by Bear]
saravana.T kumar

Joined: Jul 13, 2007
Posts: 23
Thank you, it worked.

And why should it be kept inside packages and not in the classes folder this above thing appplicable to custom tags or all jsp files which includes classes
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
saravana, did you read the JSP FAQ concerning this subject?
Don't get me started about those stupid light bulbs.
subject: Custom tags Problem
It's not a secret anymore!