File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Mr. Chace,  Could You Take A Look At This Tag Library 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 » Servlets
Bookmark "Mr. Chace,  Could You Take A Look At This Tag Library Problem." Watch "Mr. Chace,  Could You Take A Look At This Tag Library Problem." New topic

Mr. Chace, Could You Take A Look At This Tag Library Problem.

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have posted this question twice here at the JavaRanch this year. Several people (including Phil Hanna and Maha Anna)looked into the source codes, and the codes worked fine on their Tomcat. However, I have had problem to make it work on both WebLogic 5.1.0 and 6.0. Because the author of this week's book give away specializes in tag libraries, I take a chance to post the same question again. This is a very simple JSP Custom Tag, the error message I have been getting on both WebLogic 5.1.0 and WebLogic 6.0 are the same:
Parsing of JSP File '/SimpleExample.jsp' failed:
/SimpleExample.jsp(6): Could not parse deployment descriptor: cannot resolve 'csajsp-taglib.tld' into a valid tag library
probably occurred due to an error in /SimpleExample.jsp line 6:
<%@ taglib uri="csajsp-taglib.tld" prefix="csajsp" %>
There are five, but very small files involved. Please allow me to load my source code:
1. The Web application deployment descriptor, web.xml, under
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "">
Note: I have tried both

2. The tag library descriptor file, csajsp-taglib.tld, which is a .xml file, is under the same directory as where web.xml is
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
<!-- a tag library descriptor -->
<!-- after this the default space is
A tag library from Core Servlets and JavaServer Pages,
<info>Simplest example: inserts one line of output</info>
<bodycontent>empty</bodycontent> -->

3. The JSP page, SimpleExample.jsp is under
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ taglib uri="csajsp-taglib.tld" prefix="csajsp" %>
<TITLE><csajsp:example /></TITLE>
<H1><csajsp:example /></H1>
<csajsp:example />
4. The style sheet that is used in the JSP page, JSP-Styles.css, is in the same directory as where the JSP page is
<STYLE TYPE="text/css">
BODY { background-color: #FDF5E6 }
A:hover { color: red }
H1 { color: #440000;
text-align: center;
font-family: Arial Black, Arial, Helvetica, sans-serif
H2 { color: #440000;
text-align: left;
font-family: Arial, Helvetica, sans-serif
H3 { color: #440000;
text-align: left;
font-family: Arial, Helvetica, sans-serif
UL { margin-top: 0;
border-top-width: 0;
padding-top: 0
DT { font-weight: bold;
PRE { font-size: 105%;
CODE { font-size: 105%;
.TOC { font-size: 90%;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif
TH.COLORED { background-color: #FFAD00
TR.COLORED { background-color: #FFAD00
TH.TITLE { background-color: #EF8429;
font-size: 28px;
font-family: Arial, Helvetica, sans-serif;
5. The tag handler Java class file, ExampleTag.class, is under
and the below is the source code for the tag handler Java file,
package coreservlets.tags;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class ExampleTag extends TagSupport {
public int doStartTag() {
try {
JspWriter out = pageContext.getOut();
out.print("Custom tag example " +
} catch(IOException ioe) {
System.out.println("Error in ExampleTag: " + ioe);
and I typed http://localhost:7001/SimpleExample.jsp in the browser window.
Thank you.
I agree. Here's the link:
subject: Mr. Chace, Could You Take A Look At This Tag Library Problem.
jQuery in Action, 3rd edition