当前位置: 首页>>代码示例>>Java>>正文


Java PageData类代码示例

本文整理汇总了Java中javax.servlet.jsp.tagext.PageData的典型用法代码示例。如果您正苦于以下问题:Java PageData类的具体用法?Java PageData怎么用?Java PageData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PageData类属于javax.servlet.jsp.tagext包,在下文中一共展示了PageData类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * 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
 */
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);

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:34,代码来源:DebugValidator.java

示例2: validate

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * 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);

}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:35,代码来源:DebugValidator.java

示例3: validate

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
    * 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;
   }
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:25,代码来源:TagLibraryInfoImpl.java

示例4: validate

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:22,代码来源:TagLibraryInfoImpl.java

示例5: validateXmlView

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * 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());
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:42,代码来源:Validator.java

示例6: validate

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:22,代码来源:TagLibraryInfoImpl.java

示例7: validateXmlView

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * 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());
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:45,代码来源:Validator.java

示例8: validateXmlView

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
 * Validate XML view against the TagLibraryValidator classes of all imported
 * tag libraries.
 */
private static void validateXmlView(PageData xmlView, Compiler compiler)
        throws JasperException {

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

    for (Iterator 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 StringBuffer();
            }
            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());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:45,代码来源:Validator.java

示例9: validateXmlView

import javax.servlet.jsp.tagext.PageData; //导入依赖的package包/类
/**
    * 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());
}
   }
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:45,代码来源:Validator.java


注:本文中的javax.servlet.jsp.tagext.PageData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。