Hans and Pratik,
Some sample code from JSP book also does not run, getting the same problem.
Please take a look at it.
debugTags.jsp:
<%@ taglib uri="/mutlib" prefix="mut" %>
<html>
<head>
<title>Debugging Tags</title>
</head>
<body>
<h1>Debugging Tags</h1>
<h2>Cookies</h2>
<mut:debugCookies style="html"/>
</body>
</html>
---------------------------------------------------------------------
DebugCookiesTag.java:
package com.taglib.wdjsp.mut;
import java.io.IOException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
//import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.TagSupport;
public class DebugCookiesTag extends TagSupport
{
private String style = "text";
public void setStyle(String style)
{
this.style = style;
}
public String getStyle()
{
return style;
}
public int doStarTag() throws JspException
{
System.out.println("In doStartTag() of DebugCookiesTag.....");
JspWriter out = pageContext.getOut();
javax.servlet.ServletRequest req = pageContext.getRequest();
if (req instanceof HttpServletRequest)
{
HttpServletRequest httpReq = (HttpServletRequest)req;
Cookie[] cookies = httpReq.getCookies();
int l = cookies.length;
boolean doHTML = this.style.equalsIgnoreCase("HTML");
try
{
if (doHTML)
out.println("<ul>");
for(int i=0; i < l; i++)
{
Cookie cookie = cookies[i];
if (doHTML)
out.println("<li><b>");
out.println(cookie.getName());
if (doHTML)
out.println("</b>");
out.println(" = ");
out.println(cookie.getValue());
out.println('\n');
}
if (doHTML)
out.println("</ul>");
}
catch(IOException e)
{
// For JSP page to know that the exception originated from
// a tag hadler class
throw new JspTagException("I/O Exception : " + e.getMessage());
}
}
return SKIP_BODY;
}
public void release()
{
super.release();
style = "text";
}
}
-------------------------------------------------------------------------------
mut_1_0.tld:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>mut</shortname>
<info>
Manning Utility Tags from
Web Development with JavaServer Pages.
</info>
<tag>
<name>debugCookies</name>
<tagclass>com.taglib.wdjsp.mut.DebugCookiesTag</tagclass>
<attribute>
<name>style</name>
</attribute>
<bodycontent>empty</bodycontent>
<info>List the cookies associated with this page</info>
</tag>
</taglib>
--------------------------------------------------------------
taglib element in web.xml:
<taglib>
<taglib-uri>/mutlib</taglib-uri>
<taglib-location>/WEB-INF/tlds/mut_1_0.tld</taglib-location>
</taglib>
Pratik <[EMAIL PROTECTED]> on 08/12/2000 05:23:59 AM
Please respond to A mailing list about Java Server Pages specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Anurag Gaur/AmericanRe)
Subject: Re: Custom tag classes problem
does your tag called.
try to put System.out.println() and check the stdout .
or you can send me the code you tag your tld and you jsp
I will try to find it out.
bye
pratik
----- Original Message -----
From: "Hans Bergsten" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 12, 2000 12:38 PM
Subject: Re: Custom tag classes problem
> Anurag Gaur wrote:
> >
> > Hans,
> >
> > I have provided the taglib directive in the jsp page. And since the JSP
compiler
> > is not giving any errors means it finds the TLD file successfully to do
the
> > syntax
> > checking for the tags on the same page. But there is no output from the
Tag
> > handler class at runtime.
> > Any other possible problems in this scenario?
>
> So, I assume that if you look at the HTML sent to the browser, your custom
> action elements are not visible, but the output they produce is not there
> either. Is that what you mean? If so, there must be a problem with your
tag
> handlers. Send code if you want some advice.
>
> Hans
> --
> Hans Bergsten [EMAIL PROTECTED]
> Gefion Software http://www.gefionsoftware.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets