FileDocCategorySizeDatePackage
DebugValidator.javaAPI DocApache Tomcat 6.0.142995Fri Jul 20 04:20:32 BST 2007validators

DebugValidator

public class DebugValidator extends javax.servlet.jsp.tagext.TagLibraryValidator
Example tag library validator that simply dumps the XML version of each page to standard output (which will typically be sent to the file $CATALINA_HOME/logs/catalina.out). To utilize it, simply include a taglib directive for this tag library at the top of your JSP page.
author
Craig McClanahan
version
$Revision: 467217 $ $Date: 2006-10-24 05:14:34 +0200 (mar., 24 oct. 2006) $

Fields Summary
Constructors Summary
Methods Summary
public javax.servlet.jsp.tagext.ValidationMessage[]validate(java.lang.String prefix, java.lang.String uri, javax.servlet.jsp.tagext.PageData page)
Validate a JSP page. This will get invoked once per directive in the JSP page. This method will return null if the page is valid; otherwise the method should return an array of ValidationMessage objects. An array of length zero is also interpreted as no errors.

param
prefix The value of the prefix argument in this directive
param
uri The value of the URI argument in this directive
param
page The page data for this page


        System.out.println("---------- Prefix=" + prefix + " URI=" + uri +
                           "----------");

        InputStream is = page.getInputStream();
        while (true) {
            try {
                int ch = is.read();
                if (ch < 0)
                    break;
                System.out.print((char) ch);
            } catch (IOException e) {
                break;
            }
        }
        System.out.println();
        System.out.println("-----------------------------------------------");
        return (null);