Don't forget that the tld in the tlds directory and the one in the mut.jar
file should be the same.
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Robert Nicholson
> Sent: Wednesday, August 16, 2000 3:47 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Custom tag classes problem
>
>
> I've not looked at this for a while but on the discussion forum
> on the books
> web site they've spoken about how the .tld is incorrect in the
> book and how
> you need to make some changes to get mutlib working.
>
> Looks like I've got it working so I'll compare what I have to
> what you have.
>
> The DTD for tlds says that the order has to be different from what they
> supplied
> in the box. Look at bodycontent, info, attribute and compare the ordering
> with
> what yours has.
>
> Also this is my HTML file.
>
> The url is mut and the prefix is mut no mutlib as per the book.
> The authors
> really should have gotten around to updating these changes in the online
> source code.. because the books an excellent one.
>
> <%@ taglib prefix="mut" uri="/mut" %>
> <html>
> <head>
> <title>Debugging Tags</title>
> </head>
> <body>
> <h1>Debugging Tags</h1>
>
> <h2>Cookies</h2>
> <mut:debugCookies style="html"/>
>
> <h2>Output Buffering</h2>
> <mut:debugBuffer/>
>
> </body>
> </html>
>
> This is my .tld file
>
> <?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>
> Utility tags for JSP.
> </info>
> <tag>
> <name>debugBuffer</name>
> <tagclass>com.taglib.wdjsp.mut.DebugBufferTag</tagclass>
> <bodycontent>empty</bodycontent>
> <info>
> Report the current status of output buffering.
> </info>
> </tag>
>
> <tag>
> <name>debugCookies</name>
> <tagclass>com.taglib.wdjsp.mut.DebugCookiesTag</tagclass>
> <bodycontent>empty</bodycontent>
> <info>
> List the cookies accessible from this page.
> </info>
> <attribute><name>style</name></attribute>
> </tag>
>
> <tag>
> <name>url</name>
> <tagclass>com.taglib.wdjsp.mut.UrlTag</tagclass>
> <bodycontent>tagdependent</bodycontent>
> <info>
> Perform URL rewriting if required.
> </info>
> </tag>
>
> <tag>
> <name>encodeHTML</name>
> <tagclass>com.taglib.wdjsp.mut.EncodeHtmlTag</tagclass>
> <bodycontent>tagdependent</bodycontent>
> <info>
> Perform HTML encoding of enclosed text.
> </info>
> </tag>
>
> <tag>
> <name>outline</name>
> <tagclass>com.taglib.wdjsp.mut.OutlineTag</tagclass>
> <bodycontent>JSP</bodycontent>
> <info>
> Delimits a set of items comprising a nested outline.
> </info>
> </tag>
> <tag>
> <name>item</name>
> <tagclass>com.taglib.wdjsp.mut.OutlineItemTag</tagclass>
> <bodycontent>JSP</bodycontent>
> <info>
> Delineates an item, possibly including subitems,
> within a nested outline.
> </info>
> <attribute>
> <name>text</name>
> <required>true</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
> </tag>
>
> <tag>
> <name>ifProperty</name>
> <tagclass>com.taglib.wdjsp.mut.IfPropertyTag</tagclass>
> <bodycontent>JSP</bodycontent>
> <info>
> Conditionally include or exclude page content
> based on a bean property.
> </info>
> <attribute><name>name</name><required>true</required></attribute>
>
> <attribute><name>property</name><required>true</required></attribute>
> <attribute><name>action</name></attribute>
> </tag>
>
> <tag>
> <name>forProperty</name>
> <tagclass>com.taglib.wdjsp.mut.ForPropertyTag</tagclass>
> <teiclass>com.taglib.wdjsp.mut.ForPropertyTEI</teiclass>
> <bodycontent>JSP</bodycontent>
> <info>
> Loop through an indexed property.
> </info>
> <attribute><name>name</name><required>true</required></attribute>
>
> <attribute><name>property</name><required>true</required></attribute>
> <attribute><name>id</name><required>true</required></attribute>
> <attribute><name>class</name><required>true</required></attribute>
> </tag>
> </taglib>
>
> > -----Original Message-----
> > From: A mailing list about Java Server Pages specification and reference
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Anurag Gaur
> > Sent: Wednesday, August 16, 2000 3:55 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Custom tag classes problem
> >
> >
> > 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
> >
>
> ==================================================================
> =========
> 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