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


Java Constants类代码示例

本文整理汇总了Java中org.apache.catalina.startup.Constants的典型用法代码示例。如果您正苦于以下问题:Java Constants类的具体用法?Java Constants怎么用?Java Constants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getWebappConfigFileFromDirectory

import org.apache.catalina.startup.Constants; //导入依赖的package包/类
private URL getWebappConfigFileFromDirectory (File docBase, String url)
{
   URL result = null;
   File webAppContextXml =
      new File (docBase, Constants.ApplicationContextXml);
   if (webAppContextXml.exists ())
   {
      try
      {
         result = webAppContextXml.toURI ().toURL ();
      }
      catch (MalformedURLException e)
      {
         LOGGER.warn("Unable to determine web application context.xml " + docBase, e);
      }
   }
   return result;
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:19,代码来源:TomcatServer.java

示例2: configureStart

import org.apache.catalina.startup.Constants; //导入依赖的package包/类
@Override
public void configureStart(final LifecycleEvent event, final StandardContext standardContext) {
    final ContextTransaction contextTransaction = new ContextTransaction();
    contextTransaction.setProperty(org.apache.naming.factory.Constants.FACTORY, UserTransactionFactory.class.getName());
    standardContext.getNamingResources().setTransaction(contextTransaction);

    if (event != null) {
        // ensure NamingContext is available for eager usage (@Observes @Initialized(ApplicationScoped) for instance)
        standardContext.getNamingContextListener().lifecycleEvent(event);
    }

    TomcatHelper.configureJarScanner(standardContext);

    startInternal(standardContext);

    // clear a bit log for default case
    addMyFacesDefaultParameters(standardContext.getLoader().getClassLoader(), standardContext.getServletContext());

    // breaks cdi
    standardContext.setTldValidation(Boolean.parseBoolean(SystemInstance.get().getProperty("tomee.tld.validation", "false")));
    // breaks jstl
    standardContext.setXmlValidation(Boolean.parseBoolean(SystemInstance.get().getProperty("tomee.xml.validation", "false")));
}
 
开发者ID:apache,项目名称:tomee,代码行数:24,代码来源:TomcatWebAppBuilder.java

示例3: execute

import org.apache.catalina.startup.Constants; //导入依赖的package包/类
/**
 * Execute the specified command.  This logic only performs the common
 * attribute validation required by all subclasses; it does not perform
 * any functional logic directly.
 *
 * @exception BuildException if a validation error occurs
 */
public void execute() throws BuildException {

    if (path == null) {
        throw new BuildException("Must specify 'path'");
    }

    File file = new File(path, Constants.ApplicationWebXml);
    if ((!file.exists()) || (!file.canRead())) {
        throw new BuildException("Cannot find web.xml");
    }

    // Commons-logging likes having the context classloader set
    ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader
        (ValidatorTask.class.getClassLoader());

    Digester digester = DigesterFactory.newDigester(true, true, null);
    try {
        file = file.getCanonicalFile();
        InputStream stream = 
            new BufferedInputStream(new FileInputStream(file));
        InputSource is = new InputSource(file.toURL().toExternalForm());
        is.setByteStream(stream);
        digester.parse(is);
        handleOutput("web.xml validated");
    } catch (Throwable t) {
        if (isFailOnError()) {
            throw new BuildException("Validation failure", t);
        } else {
            handleErrorOutput("Validation failure: " + t);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(oldCL);
        closeRedirector();
    }

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

示例4: execute

import org.apache.catalina.startup.Constants; //导入依赖的package包/类
/**
 * Execute the specified command.  This logic only performs the common
 * attribute validation required by all subclasses; it does not perform
 * any functional logic directly.
 *
 * @exception BuildException if a validation error occurs
 */
@Override
public void execute() throws BuildException {

    if (path == null) {
        throw new BuildException("Must specify 'path'");
    }

    File file = new File(path, Constants.ApplicationWebXml);
    if ((!file.exists()) || (!file.canRead())) {
        throw new BuildException("Cannot find web.xml");
    }

    // Commons-logging likes having the context classloader set
    ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader
        (ValidatorTask.class.getClassLoader());

    Digester digester = DigesterFactory.newDigester(true, true, null);
    try {
        file = file.getCanonicalFile();
        InputStream stream = 
            new BufferedInputStream(new FileInputStream(file));
        InputSource is =
            new InputSource(file.toURI().toURL().toExternalForm());
        is.setByteStream(stream);
        digester.parse(is);
        handleOutput("web.xml validated");
    } catch (Exception e) {
        if (isFailOnError()) {
            throw new BuildException("Validation failure", e);
        } else {
            handleErrorOutput("Validation failure: " + e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(oldCL);
        closeRedirector();
    }

}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:47,代码来源:ValidatorTask.java

示例5: noDefaultWebXmlPath

import org.apache.catalina.startup.Constants; //导入依赖的package包/类
static String noDefaultWebXmlPath() {
    return Constants.NoDefaultWebXml;
}
 
开发者ID:line,项目名称:armeria,代码行数:4,代码来源:TomcatUtil.java

示例6: execute

import org.apache.catalina.startup.Constants; //导入依赖的package包/类
/**
 * Execute the specified command.  This logic only performs the common
 * attribute validation required by all subclasses; it does not perform
 * any functional logic directly.
 *
 * @exception BuildException if a validation error occurs
 */
@Override
public void execute() throws BuildException {

    if (path == null) {
        throw new BuildException("Must specify 'path'");
    }

    File file = new File(path, Constants.ApplicationWebXml);
    if ((!file.exists()) || (!file.canRead())) {
        throw new BuildException("Cannot find web.xml");
    }

    // Commons-logging likes having the context classloader set
    ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader
        (ValidatorTask.class.getClassLoader());

    // Called through trusted manager interface. If running under a
    // SecurityManager assume that untrusted applications may be deployed.
    Digester digester = DigesterFactory.newDigester(
            true, true, null, Globals.IS_SECURITY_ENABLED);
    try {
        file = file.getCanonicalFile();
        InputStream stream = 
            new BufferedInputStream(new FileInputStream(file));
        InputSource is =
            new InputSource(file.toURI().toURL().toExternalForm());
        is.setByteStream(stream);
        digester.parse(is);
        handleOutput("web.xml validated");
    } catch (Exception e) {
        if (isFailOnError()) {
            throw new BuildException("Validation failure", e);
        } else {
            handleErrorOutput("Validation failure: " + e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(oldCL);
        closeRedirector();
    }

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:50,代码来源:ValidatorTask.java


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