This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes Custom Tag and JRUN 3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom Tag and JRUN 3.1" Watch "Custom Tag and JRUN 3.1" New topic

Custom Tag and JRUN 3.1

Dave Constantineau

Joined: Sep 07, 2002
Posts: 1
Hi, I am trying to run a custom tag in JRUN.
I placed my jsp and dlt file in:
and I placed my class file in:
my dlt file looks like this:
<?xml version = "1.0" encoding = "ISO-8859-1" ?>
"-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

A simple tag library for the examples
Inserts content welcoming user to tag libraries

my java file looks like this:
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class WelcomeTagHandler extends TagSupport{
//method called to begin tag processing
public int doStartTag() throws JspException{
//attempt tag processing
//obtain jspWriter to output content
JspWriter out = pageContext.getOut();
//output content
out.print("Welcome to JSP Tag Libraries");
catch(IOException e){
throw new JspException(e.getMessage());
return SKIP_BODY;

and my jsp file looks like this:
<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<%-- taglib directive --%>
<%@ taglib uri = "advjhtp1-taglib.tld" prefix = "advjhtp1" %>
<html xmlns = "">
<title>Simple Custom Tag Example</title>
<p>The following text demonstrates a custom tag:</p>
<advjhtp1:welcome />

I get the following error when trying to run the jsp:
javax.servlet.ServletException: Parse Error in JSP page: The tag handler class '
' for custom tag 'welcome' on line '16' could not be found.

I tried everything. i tried using a package, i tried placing the class file in every possible directory. but it just can't seem to find the class file for some reason.
does anyone know where exactly all the necessary files need to be in order to run properly?
Thank you
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
As I recall, your .tld (not dlt) file should go under WEB-INF somewhere since it is not supposed to be served by the web server. Furthermore, you need to insert a taglib section in the web.xml. That is what tells JRun how to find your taglib. Its all defined in the JSP API - you should download that from
I agree. Here's the link:
subject: Custom Tag and JRUN 3.1
It's not a secret anymore!