org.apache.catalina.Context.findConstraints()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.apache.catalina.Context.findConstraints()方法的一些代码示例,展示了Context.findConstraints()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.findConstraints()方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:findConstraints

Context.findConstraints介绍

[英]Return the set of security constraints for this web application. If there are none, a zero-length array is returned.
[中]返回此web应用程序的安全约束集。如果没有,则返回零长度数组。

代码示例

代码示例来源:origin: magro/memcached-session-manager

@Override
public boolean contextHasFormBasedSecurityConstraint(){
  if(_contextHasFormBasedSecurityConstraint != null) {
    return _contextHasFormBasedSecurityConstraint.booleanValue();
  }
  final Context context = (Context)getContainer();
  final SecurityConstraint[] constraints = context.findConstraints();
  final LoginConfig loginConfig = context.getLoginConfig();
  _contextHasFormBasedSecurityConstraint = constraints != null && constraints.length > 0
      && loginConfig != null && HttpServletRequest.FORM_AUTH.equals( loginConfig.getAuthMethod() );
  return _contextHasFormBasedSecurityConstraint;
}

代码示例来源:origin: magro/memcached-session-manager

@Override
public boolean contextHasFormBasedSecurityConstraint(){
  if(_contextHasFormBasedSecurityConstraint != null) {
    return _contextHasFormBasedSecurityConstraint.booleanValue();
  }
  final Context context = getContext();
  final SecurityConstraint[] constraints = context.findConstraints();
  final LoginConfig loginConfig = context.getLoginConfig();
  _contextHasFormBasedSecurityConstraint = constraints != null && constraints.length > 0
      && loginConfig != null && Constants.FORM_METHOD.equals( loginConfig.getAuthMethod() );
  return _contextHasFormBasedSecurityConstraint;
}

代码示例来源:origin: magro/memcached-session-manager

public boolean contextHasFormBasedSecurityConstraint(){
  if(_contextHasFormBasedSecurityConstraint != null) {
    return _contextHasFormBasedSecurityConstraint.booleanValue();
  }
  final SecurityConstraint[] constraints = getContext().findConstraints();
  final LoginConfig loginConfig = getContext().getLoginConfig();
  _contextHasFormBasedSecurityConstraint = constraints != null && constraints.length > 0
      && loginConfig != null && HttpServletRequest.FORM_AUTH.equals( loginConfig.getAuthMethod() );
  return _contextHasFormBasedSecurityConstraint;
}

代码示例来源:origin: magro/memcached-session-manager

public boolean contextHasFormBasedSecurityConstraint(){
  if(_contextHasFormBasedSecurityConstraint != null) {
    return _contextHasFormBasedSecurityConstraint.booleanValue();
  }
  final SecurityConstraint[] constraints = getContext().findConstraints();
  final LoginConfig loginConfig = getContext().getLoginConfig();
  _contextHasFormBasedSecurityConstraint = constraints != null && constraints.length > 0
      && loginConfig != null && HttpServletRequest.FORM_AUTH.equals( loginConfig.getAuthMethod() );
  return _contextHasFormBasedSecurityConstraint;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 * @return a string array with a representation of each
 *  security constraint
 * @throws MBeanException propagated from the managed resource access
 */
public String[] findConstraints() throws MBeanException {
  Context context = doGetManagedResource();
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for (int counter = 0; counter < constraints.length; counter++) {
    stringConstraints[counter] = constraints[counter].toString();
  }
  return stringConstraints;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 * @return a string array with a representation of each
 *  security constraint
 * @throws MBeanException propagated from the managed resource access
 */
public String[] findConstraints() throws MBeanException {
  Context context = doGetManagedResource();
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for (int counter = 0; counter < constraints.length; counter++) {
    stringConstraints[counter] = constraints[counter].toString();
  }
  return stringConstraints;
}

代码示例来源:origin: de.javakaffee.msm/memcached-session-manager-tc8

public boolean contextHasFormBasedSecurityConstraint(){
  if(_contextHasFormBasedSecurityConstraint != null) {
    return _contextHasFormBasedSecurityConstraint.booleanValue();
  }
  final SecurityConstraint[] constraints = getContext().findConstraints();
  final LoginConfig loginConfig = getContext().getLoginConfig();
  _contextHasFormBasedSecurityConstraint = constraints != null && constraints.length > 0
      && loginConfig != null && HttpServletRequest.FORM_AUTH.equals( loginConfig.getAuthMethod() );
  return _contextHasFormBasedSecurityConstraint;
}

代码示例来源:origin: jboss.web/jbossweb

currentMappings.add(mapping);
SecurityConstraint[] constraints = ((Context) getParent()).findConstraints();
for (SecurityConstraint constraint : constraints) {
  for (SecurityCollection collection : constraint.findCollections()) {

代码示例来源:origin: org.jboss.web/jbossweb

currentMappings.add(mapping);
SecurityConstraint[] constraints = ((Context) getParent()).findConstraints();
for (SecurityConstraint constraint : constraints) {
  for (SecurityCollection collection : constraint.findCollections()) {

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 */
public String[] findConstraints() throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for(int counter=0; counter < constraints.length; counter++){
    stringConstraints[counter]=constraints[counter].toString();
  }
  
  return stringConstraints;
  
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 */
public String[] findConstraints() throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for(int counter=0; counter < constraints.length; counter++){
    stringConstraints[counter]=constraints[counter].toString();
  }
  
  return stringConstraints;
  
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 */
public String[] findConstraints() throws MBeanException {
  Context context;
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for(int counter=0; counter < constraints.length; counter++){
    stringConstraints[counter]=constraints[counter].toString();
  }
  return stringConstraints;
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 */
public String[] findConstraints() throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for(int counter=0; counter < constraints.length; counter++){
    stringConstraints[counter]=constraints[counter].toString();
  }
  
  return stringConstraints;
  
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 */
public String[] findConstraints() throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for(int counter=0; counter < constraints.length; counter++){
    stringConstraints[counter]=constraints[counter].toString();
  }
  
  return stringConstraints;
  
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Return the security constraints for this web application.
 * If there are none, a zero-length array is returned.
 */
public String[] findConstraints() throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  SecurityConstraint[] constraints = context.findConstraints();
  String[] stringConstraints = new String[constraints.length];
  for(int counter=0; counter < constraints.length; counter++){
    stringConstraints[counter]=constraints[counter].toString();
  }
  
  return stringConstraints;
  
}

代码示例来源:origin: jboss.web/jbossweb

SecurityConstraint constraints[] = context.findConstraints();
for (int i = 0; i < constraints.length; i++) {
  String roles[] = constraints[i].findAuthRoles();

代码示例来源:origin: tomcat/catalina

SecurityConstraint constraints[] = context.findConstraints();
for (int i = 0; i < constraints.length; i++) {
  String roles[] = constraints[i].findAuthRoles();

代码示例来源:origin: codefollower/Tomcat-Research

SecurityConstraint constraints[] = context.findConstraints();
for (int i = 0; i < constraints.length; i++) {
  String roles[] = constraints[i].findAuthRoles();

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

SecurityConstraint constraints[] = context.findConstraints();
for (int i = 0; i < constraints.length; i++) {
  String roles[] = constraints[i].findAuthRoles();

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

SecurityConstraint constraints[] = context.findConstraints();
for (int i = 0; i < constraints.length; i++) {
  String roles[] = constraints[i].findAuthRoles();

相关文章

微信公众号

最新文章

更多

Context类方法