本文整理汇总了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);
}
}
示例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();
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例13: ParserUtils
public ParserUtils(boolean validating) {
this(validating, Constants.IS_SECURITY_ENABLED);
}
示例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;
}
示例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();
}
}