ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/webapps/examples/WEB-INF/classes/validators/DebugValidator.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/webapps/examples/WEB-INF/classes/validators/DebugValidator.java
Status
scanned
Type
file
Name
DebugValidator.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
Perl5 module source, ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2926 (2.9 KB)
MD5
bf74bfde0d8d3a347bd4692ce46b8e33
SHA1
50c57deff9fb5f7cab22d5fd318190f98a3f31c8
SHA256
9d5431779885429802035d7ca3153e7c5c3c06140952320886a89b1829d69f71
SHA512

      
    
SHA1_git
8c88cdf8966fb0ec2cc37c5051e672bcbd6c8a2d
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
DebugValidator.java | 2.9 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package validators; import java.io.IOException; import java.io.InputStream; import jakarta.servlet.jsp.tagext.PageData; import jakarta.servlet.jsp.tagext.TagLibraryValidator; import jakarta.servlet.jsp.tagext.ValidationMessage; /** * Example tag library validator that simply dumps the XML version of each * page to standard output (which will typically be sent to the file * <code>$CATALINA_HOME/logs/catalina.out</code>). To utilize it, simply * include a <code>taglib</code> directive for this tag library at the top * of your JSP page. */ public class DebugValidator extends TagLibraryValidator { // ----------------------------------------------------- Instance Variables // --------------------------------------------------------- Public Methods /** * Validate a JSP page. This will get invoked once per directive in the * JSP page. This method will return <code>null</code> if the page is * valid; otherwise the method should return an array of * <code>ValidationMessage</code> 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 */ @Override public ValidationMessage[] validate(String prefix, String uri, PageData 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 ioe) { break; } } System.out.println(); System.out.println("-----------------------------------------------"); return null; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
35.63
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9