Can't use tag library

M

Mark McKay

I'm following a tutorial from Sun to try to create a custom tag
library using Netbeans/Java 1.4.2. At the moment, I've created a tag
library called MyTagLib.tdl, generated a tag class in
/WEB-INF/Classes/MyTagLib/HelloWorld.java, and updated my web.xml file
to include the new tag. However, when I try to compile and run a JSP
page that refrences this tag, I get a compiler error of

Unable to load class MyTagLib.HelloWorldTag

which strikes me as odd, since this class is available in my Classes
directory.

Any idea what I can do to get my linker working?

Here's my web.xml entries:

<taglib>
<taglib-uri>myTags</taglib-uri>
<taglib-location>/MyTagLib.tld</taglib-location>
</taglib>

This is the JSP file:

<%@page contentType="text/html"%>
<%@taglib uri="myTags" prefix="mt"%>
<html>
<head><title>JSP Page</title></head>
<body>

<mt:HelloWorld />

</body>
</html>
 
W

Wendy S

Mark McKay said:
I'm following a tutorial from Sun to try to create a custom tag
library using Netbeans/Java 1.4.2. At the moment, I've created a tag
library called MyTagLib.tdl, generated a tag class in
/WEB-INF/Classes/MyTagLib/HelloWorld.java, and updated my web.xml file
to include the new tag. However, when I try to compile and run a JSP
page that refrences this tag, I get a compiler error of

Unable to load class MyTagLib.HelloWorldTag

which strikes me as odd, since this class is available in my Classes
directory.

But it should be in WEB-INF/classes -- with a small 'c'.

(While we're on the subject, package names are generally lowercase...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top