1 16 17 18 package validators; 19 20 21 import java.io.InputStream ; 22 import java.io.IOException ; 23 import javax.servlet.jsp.tagext.PageData ; 24 import javax.servlet.jsp.tagext.TagLibraryValidator ; 25 import javax.servlet.jsp.tagext.ValidationMessage ; 26 27 28 38 39 public class DebugValidator extends TagLibraryValidator { 40 41 42 44 45 47 48 59 public ValidationMessage [] validate(String prefix, String uri, 60 PageData page) { 61 62 System.out.println("---------- Prefix=" + prefix + " URI=" + uri + 63 "----------"); 64 65 InputStream is = page.getInputStream(); 66 while (true) { 67 try { 68 int ch = is.read(); 69 if (ch < 0) 70 break; 71 System.out.print((char) ch); 72 } catch (IOException e) { 73 break; 74 } 75 } 76 System.out.println(); 77 System.out.println("-----------------------------------------------"); 78 return (null); 79 80 } 81 82 83 } 84 | Popular Tags |