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


Java SecurityConstraint.findCollections方法代码示例

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


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

示例1: addConstraint

import org.apache.catalina.deploy.SecurityConstraint; //导入方法依赖的package包/类
/**
 * Add a security constraint to the set for this web application.
 */
@Override
public void addConstraint(SecurityConstraint constraint) {

    // Validate the proposed constraint
    SecurityCollection collections[] = constraint.findCollections();
    for (int i = 0; i < collections.length; i++) {
        String patterns[] = collections[i].findPatterns();
        for (int j = 0; j < patterns.length; j++) {
            patterns[j] = adjustURLPattern(patterns[j]);
            if (!validateURLPattern(patterns[j]))
                throw new IllegalArgumentException
                    (sm.getString
                     ("standardContext.securityConstraint.pattern",
                      patterns[j]));
        }
        if (collections[i].findMethods().length > 0 &&
                collections[i].findOmittedMethods().length > 0) {
            throw new IllegalArgumentException(sm.getString(
                    "standardContext.securityConstraint.mixHttpMethod"));
        }
    }

    // Add this constraint to the set for our web application
    synchronized (constraintsLock) {
        SecurityConstraint results[] =
            new SecurityConstraint[constraints.length + 1];
        for (int i = 0; i < constraints.length; i++)
            results[i] = constraints[i];
        results[constraints.length] = constraint;
        constraints = results;
    }

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

示例2: addConstraint

import org.apache.catalina.deploy.SecurityConstraint; //导入方法依赖的package包/类
/**
 * Add a security constraint to the set for this web application.
 */
public void addConstraint(SecurityConstraint constraint) {

    // Validate the proposed constraint
    SecurityCollection collections[] = constraint.findCollections();
    for (int i = 0; i < collections.length; i++) {
        String patterns[] = collections[i].findPatterns();
        for (int j = 0; j < patterns.length; j++) {
            patterns[j] = adjustURLPattern(patterns[j]);
            if (!validateURLPattern(patterns[j]))
                throw new IllegalArgumentException
                    (sm.getString
                     ("standardContext.securityConstraint.pattern",
                      patterns[j]));
        }
    }

    // Add this constraint to the set for our web application
    synchronized (constraints) {
        SecurityConstraint results[] =
            new SecurityConstraint[constraints.length + 1];
        for (int i = 0; i < constraints.length; i++)
            results[i] = constraints[i];
        results[constraints.length] = constraint;
        constraints = results;
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:StandardContext.java

示例3: addConstraint

import org.apache.catalina.deploy.SecurityConstraint; //导入方法依赖的package包/类
/**
 * Add a security constraint to the set for this web application.
 */
@Override
public void addConstraint(SecurityConstraint constraint) {

	// Validate the proposed constraint
	SecurityCollection collections[] = constraint.findCollections();
	for (int i = 0; i < collections.length; i++) {
		String patterns[] = collections[i].findPatterns();
		for (int j = 0; j < patterns.length; j++) {
			patterns[j] = adjustURLPattern(patterns[j]);
			if (!validateURLPattern(patterns[j]))
				throw new IllegalArgumentException(
						sm.getString("standardContext.securityConstraint.pattern", patterns[j]));
		}
		if (collections[i].findMethods().length > 0 && collections[i].findOmittedMethods().length > 0) {
			throw new IllegalArgumentException(sm.getString("standardContext.securityConstraint.mixHttpMethod"));
		}
	}

	// Add this constraint to the set for our web application
	synchronized (constraintsLock) {
		SecurityConstraint results[] = new SecurityConstraint[constraints.length + 1];
		for (int i = 0; i < constraints.length; i++)
			results[i] = constraints[i];
		results[constraints.length] = constraint;
		constraints = results;
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:32,代码来源:StandardContext.java


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