Java Code Examples for javax.servlet.jsp.tagext.PageData#getInputStream()

The following examples show how to use javax.servlet.jsp.tagext.PageData#getInputStream() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DebugValidator.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * 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 e) {
            break;
        }
    }
    System.out.println();
    System.out.println("-----------------------------------------------");
    return null;

}
 
Example 2
Source File: DebugValidator.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * 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 e) {
            break;
        }
    }
    System.out.println();
    System.out.println("-----------------------------------------------");
    return null;

}
 
Example 3
Source File: DebugValidator.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * 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 e) {
            break;
        }
    }
    System.out.println();
    System.out.println("-----------------------------------------------");
    return (null);

}
 
Example 4
Source File: DebugValidator.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * 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 e) {
            break;
        }
    }
    System.out.println();
    System.out.println("-----------------------------------------------");
    return (null);

}
 
Example 5
Source File: DebugValidator.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * 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 e) {
            break;
        }
    }
    System.out.println();
    System.out.println("-----------------------------------------------");
    return (null);

}