类javax.servlet.jsp.tagext.PageData源码实例Demo

下面列出了怎么用javax.servlet.jsp.tagext.PageData的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Tomcat8-Source-Read   文件: DebugValidator.java
/**
 * 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;

}
 
源代码2 项目: Tomcat8-Source-Read   文件: DebugValidator.java
/**
 * 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;

}
 
源代码3 项目: tomcatsrc   文件: DebugValidator.java
/**
 * 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);

}
 
源代码4 项目: tomcatsrc   文件: DebugValidator.java
/**
 * 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);

}
 
源代码5 项目: tomcatsrc   文件: DebugValidator.java
/**
 * 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);

}
 
源代码6 项目: packagedrone   文件: TagLibraryInfoImpl.java
/**
    * Translation-time validation of the XML document
    * associated with the JSP page.
    * This is a convenience method on the associated 
    * TagLibraryValidator class.
    *
    * @param thePage The JSP page object
    * @return A string indicating whether the page is valid or not.
    */
   public ValidationMessage[] validate(PageData thePage) {
TagLibraryValidator tlv = getTagLibraryValidator();
if (tlv == null) return null;

       String uri = getURI();
       if (uri.startsWith("/")) {
           uri = URN_JSPTLD + uri;
       }

       ValidationMessage[] messages = tlv.validate(getPrefixString(), uri,
                                                   thePage);
       tlv.release();

       return messages;
   }
 
源代码7 项目: Tomcat8-Source-Read   文件: TagLibraryInfoImpl.java
/**
 * Translation-time validation of the XML document associated with the JSP
 * page. This is a convenience method on the associated TagLibraryValidator
 * class.
 *
 * @param thePage
 *            The JSP page object
 * @return A string indicating whether the page is valid or not.
 */
public ValidationMessage[] validate(PageData thePage) {
    TagLibraryValidator tlv = getTagLibraryValidator();
    if (tlv == null)
        return null;

    String uri = getURI();
    if (uri.startsWith("/")) {
        uri = URN_JSPTLD + uri;
    }

    return tlv.validate(getPrefixString(), uri, thePage);
}
 
源代码8 项目: Tomcat7.0.67   文件: TagLibraryInfoImpl.java
/**
 * Translation-time validation of the XML document associated with the JSP
 * page. This is a convenience method on the associated TagLibraryValidator
 * class.
 * 
 * @param thePage
 *            The JSP page object
 * @return A string indicating whether the page is valid or not.
 */
public ValidationMessage[] validate(PageData thePage) {
    TagLibraryValidator tlv = getTagLibraryValidator();
    if (tlv == null)
        return null;

    String uri = getURI();
    if (uri.startsWith("/")) {
        uri = URN_JSPTLD + uri;
    }

    return tlv.validate(getPrefixString(), uri, thePage);
}
 
源代码9 项目: tomcatsrc   文件: TagLibraryInfoImpl.java
/**
 * Translation-time validation of the XML document associated with the JSP
 * page. This is a convenience method on the associated TagLibraryValidator
 * class.
 * 
 * @param thePage
 *            The JSP page object
 * @return A string indicating whether the page is valid or not.
 */
public ValidationMessage[] validate(PageData thePage) {
    TagLibraryValidator tlv = getTagLibraryValidator();
    if (tlv == null)
        return null;

    String uri = getURI();
    if (uri.startsWith("/")) {
        uri = URN_JSPTLD + uri;
    }

    return tlv.validate(getPrefixString(), uri, thePage);
}
 
源代码10 项目: Tomcat8-Source-Read   文件: Validator.java
/**
 * Validate XML view against the TagLibraryValidator classes of all imported
 * tag libraries.
 */
private static void validateXmlView(PageData xmlView, Compiler compiler)
        throws JasperException {

    StringBuilder errMsg = null;
    ErrorDispatcher errDisp = compiler.getErrorDispatcher();

    for (Iterator<TagLibraryInfo> iter =
        compiler.getPageInfo().getTaglibs().iterator(); iter.hasNext();) {

        Object o = iter.next();
        if (!(o instanceof TagLibraryInfoImpl))
            continue;
        TagLibraryInfoImpl tli = (TagLibraryInfoImpl) o;

        ValidationMessage[] errors = tli.validate(xmlView);
        if ((errors != null) && (errors.length != 0)) {
            if (errMsg == null) {
                errMsg = new StringBuilder();
            }
            errMsg.append("<h3>");
            errMsg.append(Localizer.getMessage(
                    "jsp.error.tlv.invalid.page", tli.getShortName(),
                    compiler.getPageInfo().getJspFile()));
            errMsg.append("</h3>");
            for (int i = 0; i < errors.length; i++) {
                if (errors[i] != null) {
                    errMsg.append("<p>");
                    errMsg.append(errors[i].getId());
                    errMsg.append(": ");
                    errMsg.append(errors[i].getMessage());
                    errMsg.append("</p>");
                }
            }
        }
    }

    if (errMsg != null) {
        errDisp.jspError(errMsg.toString());
    }
}
 
源代码11 项目: Tomcat7.0.67   文件: Validator.java
/**
 * Validate XML view against the TagLibraryValidator classes of all imported
 * tag libraries.
 */
private static void validateXmlView(PageData xmlView, Compiler compiler)
        throws JasperException {

    StringBuilder errMsg = null;
    ErrorDispatcher errDisp = compiler.getErrorDispatcher();

    for (Iterator<TagLibraryInfo> iter =
        compiler.getPageInfo().getTaglibs().iterator(); iter.hasNext();) {

        Object o = iter.next();
        if (!(o instanceof TagLibraryInfoImpl))
            continue;
        TagLibraryInfoImpl tli = (TagLibraryInfoImpl) o;

        ValidationMessage[] errors = tli.validate(xmlView);
        if ((errors != null) && (errors.length != 0)) {
            if (errMsg == null) {
                errMsg = new StringBuilder();
            }
            errMsg.append("<h3>");
            errMsg.append(Localizer.getMessage(
                    "jsp.error.tlv.invalid.page", tli.getShortName(),
                    compiler.getPageInfo().getJspFile()));
            errMsg.append("</h3>");
            for (int i = 0; i < errors.length; i++) {
                if (errors[i] != null) {
                    errMsg.append("<p>");
                    errMsg.append(errors[i].getId());
                    errMsg.append(": ");
                    errMsg.append(errors[i].getMessage());
                    errMsg.append("</p>");
                }
            }
        }
    }

    if (errMsg != null) {
        errDisp.jspError(errMsg.toString());
    }
}
 
源代码12 项目: tomcatsrc   文件: Validator.java
/**
 * Validate XML view against the TagLibraryValidator classes of all imported
 * tag libraries.
 */
private static void validateXmlView(PageData xmlView, Compiler compiler)
        throws JasperException {

    StringBuilder errMsg = null;
    ErrorDispatcher errDisp = compiler.getErrorDispatcher();

    for (Iterator<TagLibraryInfo> iter =
        compiler.getPageInfo().getTaglibs().iterator(); iter.hasNext();) {

        Object o = iter.next();
        if (!(o instanceof TagLibraryInfoImpl))
            continue;
        TagLibraryInfoImpl tli = (TagLibraryInfoImpl) o;

        ValidationMessage[] errors = tli.validate(xmlView);
        if ((errors != null) && (errors.length != 0)) {
            if (errMsg == null) {
                errMsg = new StringBuilder();
            }
            errMsg.append("<h3>");
            errMsg.append(Localizer.getMessage(
                    "jsp.error.tlv.invalid.page", tli.getShortName(),
                    compiler.getPageInfo().getJspFile()));
            errMsg.append("</h3>");
            for (int i = 0; i < errors.length; i++) {
                if (errors[i] != null) {
                    errMsg.append("<p>");
                    errMsg.append(errors[i].getId());
                    errMsg.append(": ");
                    errMsg.append(errors[i].getMessage());
                    errMsg.append("</p>");
                }
            }
        }
    }

    if (errMsg != null) {
        errDisp.jspError(errMsg.toString());
    }
}
 
源代码13 项目: packagedrone   文件: Validator.java
/**
    * Validate XML view against the TagLibraryValidator classes of all
    * imported tag libraries.
    */
   private static void validateXmlView(PageData xmlView, Compiler compiler)
        throws JasperException {

StringBuilder errMsg = null;
ErrorDispatcher errDisp = compiler.getErrorDispatcher();

for (Iterator<TagLibraryInfo> iter = 
                    compiler.getPageInfo().getTaglibs().iterator();
         iter.hasNext(); ) {

    TagLibraryInfo o = iter.next();
    if (!(o instanceof TagLibraryInfoImpl))
	continue;
    TagLibraryInfoImpl tli = (TagLibraryInfoImpl) o;

    ValidationMessage[] errors = tli.validate(xmlView);
           if ((errors != null) && (errors.length != 0)) {
               if (errMsg == null) {
	    errMsg = new StringBuilder();
	}
               errMsg.append("<h3>");
               errMsg.append(Localizer.getMessage("jsp.error.tlv.invalid.page",
					   tli.getShortName()));
               errMsg.append("</h3>");
               for (int i=0; i<errors.length; i++) {
	    if (errors[i] != null) {
		errMsg.append("<p>");
		errMsg.append(errors[i].getId());
		errMsg.append(": ");
		errMsg.append(errors[i].getMessage());
		errMsg.append("</p>");
	    }
               }
           }
       }

if (errMsg != null) {
           errDisp.jspError(errMsg.toString());
}
   }
 
 类所在包
 类方法
 同包方法