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


Java TreeNode.findAttribute方法代码示例

本文整理汇总了Java中org.apache.jasper.xmlparser.TreeNode.findAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.findAttribute方法的具体用法?Java TreeNode.findAttribute怎么用?Java TreeNode.findAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jasper.xmlparser.TreeNode的用法示例。


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

示例1: getVersion

import org.apache.jasper.xmlparser.TreeNode; //导入方法依赖的package包/类
private double getVersion(TreeNode webApp) {
    String v = webApp.findAttribute("version");
    if (v != null) {
        try {
            return Double.parseDouble(v);
        } catch (NumberFormatException e) {
        }
    }
    return 2.3;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:JspConfig.java

示例2: getVersion

import org.apache.jasper.xmlparser.TreeNode; //导入方法依赖的package包/类
private double getVersion(TreeNode webApp) {
	String v = webApp.findAttribute("version");
	if (v != null) {
		try {
			return Double.parseDouble(v);
		} catch (NumberFormatException e) {
		}
	}
	return 2.3;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:11,代码来源:JspConfig.java

示例3: parseImplicitTld

import org.apache.jasper.xmlparser.TreeNode; //导入方法依赖的package包/类
/**
 * Parses the JSP version and tlib-version from the implicit.tld at the
 * given path.
 */
private void parseImplicitTld(JspCompilationContext ctxt, String path)
        throws JasperException {

    InputStream is = null;
    TreeNode tld = null;

    try {
        URL uri = ctxt.getResource(path);
        if (uri == null) {
            // no implicit.tld
            return;
        }

        is = uri.openStream();
        /* SJSAS 6384538
        tld = new ParserUtils().parseXMLDocument(IMPLICIT_TLD, is);
        */
        // START SJSAS 6384538
        tld = new ParserUtils().parseXMLDocument(
            IMPLICIT_TLD, is, ctxt.getOptions().isValidationEnabled());
        // END SJSAS 6384538
    } catch (Exception ex) {
        throw new JasperException(ex);
    } finally {
        if (is != null) {
            try {
                is.close();
            } catch (Throwable t) {}
        }
    }

    this.jspversion = tld.findAttribute("version");

    Iterator list = tld.findChildren();
    while (list.hasNext()) {
        TreeNode element = (TreeNode) list.next();
        String tname = element.getName();
        if ("tlibversion".equals(tname)
                || "tlib-version".equals(tname)) {
            this.tlibversion = element.getBody();
        } else if ("jspversion".equals(tname)
                || "jsp-version".equals(tname)) {
            this.jspversion = element.getBody();
        } else if (!"shortname".equals(tname)
                && !"short-name".equals(tname)) {
            err.jspError("jsp.error.implicitTld.additionalElements",
                         path, tname);
        }
    }

    // JSP version in implicit.tld must be 2.0 or greater
    Double jspVersionDouble = Double.valueOf(this.jspversion);
    if (Double.compare(jspVersionDouble, Constants.JSP_VERSION_2_0) < 0) {
        err.jspError("jsp.error.implicitTld.jspVersion", path,
                     this.jspversion);
    }
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:62,代码来源:ImplicitTagLibraryInfo.java

示例4: parseImplicitTld

import org.apache.jasper.xmlparser.TreeNode; //导入方法依赖的package包/类
/**
 * Parses the JSP version and tlib-version from the implicit.tld at the
 * given path.
 */
private void parseImplicitTld(JspCompilationContext ctxt, String path)
        throws JasperException {

    InputStream is = null;
    TreeNode tld = null;

    try {
        URL uri = ctxt.getResource(path);
        if (uri == null) {
            // no implicit.tld
            return;
        }

        is = uri.openStream();
        /* SJSAS 6384538
        tld = new ParserUtils().parseXMLDocument(IMPLICIT_TLD, is);
        */
        // START SJSAS 6384538
        boolean blockExternal = Boolean.parseBoolean(ctxt.getServletContext()
               .getInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM));
        tld = new ParserUtils(blockExternal).parseXMLDocument(
            IMPLICIT_TLD, is, ctxt.getOptions().isValidationEnabled());
        // END SJSAS 6384538
    } catch (Exception ex) {
        throw new JasperException(ex);
    } finally {
        if (is != null) {
            try {
                is.close();
            } catch (Throwable t) {}
        }
    }

    this.jspversion = tld.findAttribute("version");

    Iterator list = tld.findChildren();
    while (list.hasNext()) {
        TreeNode element = (TreeNode) list.next();
        String tname = element.getName();
        if ("tlibversion".equals(tname)
                || "tlib-version".equals(tname)) {
            this.tlibversion = element.getBody();
        } else if ("jspversion".equals(tname)
                || "jsp-version".equals(tname)) {
            this.jspversion = element.getBody();
        } else if (!"shortname".equals(tname)
                && !"short-name".equals(tname)) {
            err.jspError("jsp.error.implicitTld.additionalElements",
                         path, tname);
        }
    }

    // JSP version in implicit.tld must be 2.0 or greater
    Double jspVersionDouble = Double.valueOf(this.jspversion);
    if (Double.compare(jspVersionDouble, Constants.JSP_VERSION_2_0) < 0) {
        err.jspError("jsp.error.implicitTld.jspVersion", path,
                     this.jspversion);
    }
}
 
开发者ID:ctron,项目名称:package-drone,代码行数:64,代码来源:ImplicitTagLibraryInfo.java


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