本文整理汇总了Java中javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic.DENY属性的典型用法代码示例。如果您正苦于以下问题:Java EmptyRoleSemantic.DENY属性的具体用法?Java EmptyRoleSemantic.DENY怎么用?Java EmptyRoleSemantic.DENY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic
的用法示例。
在下文中一共展示了EmptyRoleSemantic.DENY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEmptyRoleSemantic
private EmptyRoleSemantic getEmptyRoleSemantic(String emptyRole) {
return emptyRole.equalsIgnoreCase("deny") ? EmptyRoleSemantic.DENY : emptyRole.equalsIgnoreCase("permit") ? EmptyRoleSemantic.PERMIT : null;
}
示例2: HttpConstraintElement
/**
* Constructor to establish all of getEmptyRoleSemantic,
* getRolesAllowed, and getTransportGuarantee.
*
* @param semantic <tt>EmptyRoleSemantic.DENY</tt> or
* <tt>EmptyRoleSemantic.PERMIT</tt>
* @param guarantee <tt>TransportGuarantee.NONE</tt> or
* <tt>TransportGuarantee.CONFIDENTIAL<tt>
* @param roleNames the names of the roles that are to be allowed
* access, or missing if the semantic is <tt>EmptyRoleSemantic.DENY</tt>
*/
public HttpConstraintElement(EmptyRoleSemantic semantic,
TransportGuarantee guarantee, String... roleNames) {
if (semantic == EmptyRoleSemantic.DENY && roleNames.length > 0) {
throw new IllegalArgumentException(
"Deny semantic with rolesAllowed");
}
this.emptyRoleSemantic = semantic;
this.transportGuarantee = guarantee;
this.rolesAllowed = copyStrings(roleNames);
}