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


Java Constants.IS_SECURITY_ENABLED属性代码示例

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


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

示例1: getPageContext

@Override
public PageContext getPageContext(Servlet servlet, ServletRequest request,
        ServletResponse response, String errorPageURL, boolean needsSession,
        int bufferSize, boolean autoflush) {

    if( Constants.IS_SECURITY_ENABLED ) {
        PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
                this, servlet, request, response, errorPageURL,
                needsSession, bufferSize, autoflush);
        return AccessController.doPrivileged(dp);
    } else {
        return internalGetPageContext(servlet, request, response,
                errorPageURL, needsSession,
                bufferSize, autoflush);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:16,代码来源:JspFactoryImpl.java

示例2: getCanonicalName

/**
 * Convert a binary class name into a canonical one that can be used
 * when generating Java source code.
 * 
 * @param className
 *            Binary class name
 * @return Canonical equivalent
 */
private String getCanonicalName(String className) throws JasperException {
	Class<?> clazz;

	ClassLoader tccl;
	if (Constants.IS_SECURITY_ENABLED) {
		PrivilegedAction<ClassLoader> pa = new PrivilegedGetTccl();
		tccl = AccessController.doPrivileged(pa);
	} else {
		tccl = Thread.currentThread().getContextClassLoader();
	}

	try {
		clazz = Class.forName(className, false, tccl);
	} catch (ClassNotFoundException e) {
		throw new JasperException(e);
	}
	return clazz.getCanonicalName();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:26,代码来源:ELFunctionMapper.java

示例3: introspecthelper

public static void introspecthelper(Object bean, String prop,
                                      String value, ServletRequest request,
                                      String param, boolean ignoreMethodNF)
                                      throws JasperException
  {
      if( Constants.IS_SECURITY_ENABLED ) {
          try {
              PrivilegedIntrospectHelper dp =
    new PrivilegedIntrospectHelper(
	bean,prop,value,request,param,ignoreMethodNF);
              AccessController.doPrivileged(dp);
          } catch( PrivilegedActionException pe) {
              Exception e = pe.getException();
              throw (JasperException)e;
          }
      } else {
          internalIntrospecthelper(
bean,prop,value,request,param,ignoreMethodNF);
      }
  }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:JspRuntimeLibrary.java

示例4: isPackageProtectionEnabled

/**
 * Return the <code>SecurityManager</code> only if Security is enabled AND
 * package protection mechanism is enabled.
 */
public static boolean isPackageProtectionEnabled(){
    if (packageDefinitionEnabled && Constants.IS_SECURITY_ENABLED){
        return true;
    }
    return false;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:SecurityUtil.java

示例5: releasePageContext

@Override
public void releasePageContext(PageContext pc) {
    if( pc == null )
        return;
    if( Constants.IS_SECURITY_ENABLED ) {
        PrivilegedReleasePageContext dp = new PrivilegedReleasePageContext(
                this,pc);
        AccessController.doPrivileged(dp);
    } else {
        internalReleasePageContext(pc);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:12,代码来源:JspFactoryImpl.java

示例6: getJspApplicationContext

@Override
public JspApplicationContext getJspApplicationContext(
        final ServletContext context) {
    if (Constants.IS_SECURITY_ENABLED) {
        return AccessController.doPrivileged(
                new PrivilegedAction<JspApplicationContext>() {
            @Override
            public JspApplicationContext run() {
                return JspApplicationContextImpl.getInstance(context);
            }
        });
    } else {
        return JspApplicationContextImpl.getInstance(context);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:15,代码来源:JspFactoryImpl.java

示例7: getDefaultResolver

public static ELResolver getDefaultResolver() {
    if (Constants.IS_SECURITY_ENABLED) {
        CompositeELResolver defaultResolver = new CompositeELResolver();
        defaultResolver.add(new MapELResolver());
        defaultResolver.add(new ResourceBundleELResolver());
        defaultResolver.add(new ListELResolver());
        defaultResolver.add(new ArrayELResolver());
        defaultResolver.add(new BeanELResolver());
        return defaultResolver;
    } else {
        return DefaultResolver;
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:ELContextImpl.java

示例8: getPageContext

@Override
public PageContext getPageContext(Servlet servlet, ServletRequest request, ServletResponse response,
		String errorPageURL, boolean needsSession, int bufferSize, boolean autoflush) {

	if (Constants.IS_SECURITY_ENABLED) {
		PrivilegedGetPageContext dp = new PrivilegedGetPageContext(this, servlet, request, response, errorPageURL,
				needsSession, bufferSize, autoflush);
		return AccessController.doPrivileged(dp);
	} else {
		return internalGetPageContext(servlet, request, response, errorPageURL, needsSession, bufferSize,
				autoflush);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:JspFactoryImpl.java

示例9: getPageContext

public PageContext getPageContext(Servlet servlet, ServletRequest request,
        ServletResponse response, String errorPageURL, boolean needsSession,
        int bufferSize, boolean autoflush) {

    if( Constants.IS_SECURITY_ENABLED ) {
        PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
                (JspFactoryImpl)this, servlet, request, response, errorPageURL,
                needsSession, bufferSize, autoflush);
        return (PageContext)AccessController.doPrivileged(dp);
    } else {
        return internalGetPageContext(servlet, request, response,
                errorPageURL, needsSession,
                bufferSize, autoflush);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:JspFactoryImpl.java

示例10: releasePageContext

public void releasePageContext(PageContext pc) {
    if( pc == null )
        return;
    if( Constants.IS_SECURITY_ENABLED ) {
        PrivilegedReleasePageContext dp = new PrivilegedReleasePageContext(
                (JspFactoryImpl)this,pc);
        AccessController.doPrivileged(dp);
    } else {
        internalReleasePageContext(pc);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:JspFactoryImpl.java

示例11: getJspApplicationContext

@Override
public JspApplicationContext getJspApplicationContext(final ServletContext context) {
	if (Constants.IS_SECURITY_ENABLED) {
		return AccessController.doPrivileged(new PrivilegedAction<JspApplicationContext>() {
			@Override
			public JspApplicationContext run() {
				return JspApplicationContextImpl.getInstance(context);
			}
		});
	} else {
		return JspApplicationContextImpl.getInstance(context);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:JspFactoryImpl.java

示例12: isPackageProtectionEnabled

/**
 * Return the <code>SecurityManager</code> only if Security is enabled AND
 * package protection mechanism is enabled.
 */
public static boolean isPackageProtectionEnabled() {
	if (packageDefinitionEnabled && Constants.IS_SECURITY_ENABLED) {
		return true;
	}
	return false;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:10,代码来源:SecurityUtil.java

示例13: ParserUtils

public ParserUtils(boolean validating) {
    this(validating, Constants.IS_SECURITY_ENABLED);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:3,代码来源:ParserUtils.java

示例14: JspRuntimeContext

/**
 * Create a JspRuntimeContext for a web application context.
 *
 * Loads in any previously generated dependencies from file.
 *
 * @param context ServletContext for web application
 */
public JspRuntimeContext(ServletContext context, Options options) {

    this.context = context;
    this.options = options;

    // Get the parent class loader
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    if (loader == null) {
        loader = this.getClass().getClassLoader();
    }

    if (log.isDebugEnabled()) {
        if (loader != null) {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           loader.toString()));
        } else {
            log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
                                           "<none>"));
        }
    }

    parentClassLoader =  loader;
    classpath = initClassPath();

    if (context instanceof org.apache.jasper.servlet.JspCServletContext) {
        codeSource = null;
        permissionCollection = null;
        return;
    }

    if (Constants.IS_SECURITY_ENABLED) {
        SecurityHolder holder = initSecurity();
        codeSource = holder.cs;
        permissionCollection = holder.pc;
    } else {
        codeSource = null;
        permissionCollection = null;
    }

    // If this web application context is running from a
    // directory, start the background compilation thread
    String appBase = context.getRealPath("/");         
    if (!options.getDevelopment()
            && appBase != null
            && options.getCheckInterval() > 0) {
        lastCompileCheck = System.currentTimeMillis();
    }                                            

    if (options.getMaxLoadedJsps() > 0) {
        jspQueue = new FastRemovalDequeue<JspServletWrapper>(options.getMaxLoadedJsps());
        if (log.isDebugEnabled()) {
            log.debug(Localizer.getMessage("jsp.message.jsp_queue_created",
                                           "" + options.getMaxLoadedJsps(), context.getContextPath()));
        }
    }

    /* Init parameter is in seconds, locally we use milliseconds */
    jspIdleTimeout = options.getJspIdleTimeout() * 1000;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:66,代码来源:JspRuntimeContext.java

示例15: JspRuntimeContext

/**
    * Create a JspRuntimeContext for a web application context.
    *
    * Loads in any previously generated dependencies from file.
    *
    * @param context ServletContext for web application
    */
   public JspRuntimeContext(ServletContext context, Options options) {

       this.context = context;
       this.options = options;

       // Get the parent class loader
       parentClassLoader = Thread.currentThread().getContextClassLoader();
       if (parentClassLoader == null) {
           parentClassLoader = this.getClass().getClassLoader();
       }

if (log.isDebugEnabled()) {
    if (parentClassLoader != null) {
	log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
				       parentClassLoader.toString()));
    } else {
	log.debug(Localizer.getMessage("jsp.message.parent_class_loader_is",
				       "<none>"));
    }
       }

       initClassPath();

if (context instanceof org.apache.jasper.servlet.JspCServletContext) {
    return;
}

       if (Constants.IS_SECURITY_ENABLED) {
           initSecurity();
       }

       // If this web application context is running from a
       // directory, start the background compilation thread
       String appBase = context.getRealPath("/");         
       if (!options.getDevelopment()
               && appBase != null
               && options.getCheckInterval() > 0) {
           lastCheck = System.currentTimeMillis();
       }                                            
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:47,代码来源:JspRuntimeContext.java


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