Search in sources :

Example 1 with TomcatBoot

use of org.dbflute.tomcat.TomcatBoot in project fess by codelibs.

the class FessBoot method main.

// ===================================================================================
// main
// ============
public static void main(final String[] args) {
    // update java.io.tmpdir
    final String tempPath = System.getProperty(FESS_TEMP_PATH);
    if (tempPath != null) {
        System.setProperty(JAVA_IO_TMPDIR, tempPath);
    }
    final TomcatBoot tomcatBoot = // 
    new FessBoot(getPort(), getContextPath()).useTldDetect();
    if (tempPath != null) {
        tomcatBoot.atBaseDir(new File(tempPath, "webapp").getAbsolutePath());
    }
    final String tomcatConfigPath = getTomcatConfigPath();
    if (tomcatConfigPath != null) {
        // e.g. URIEncoding
        tomcatBoot.configure(tomcatConfigPath);
    }
    tomcatBoot.logging(LOGGING_PROPERTIES, op -> {
        op.ignoreNoFile();
        String fessLogPath = System.getProperty("fess.log.path");
        if (fessLogPath == null) {
            fessLogPath = "../../logs";
        }
        op.replace("fess.log.path", fessLogPath.replace("\\", "/"));
    }).asYouLikeIt(resource -> {
        final Host host = resource.getHost();
        if (host instanceof StandardHost) {
            ((StandardHost) host).setErrorReportValveClass(SuppressErrorReportValve.class.getName());
        }
    }).useTldDetect(jarName -> (jarName.contains("jstl") || jarName.contains("lasta-taglib"))).asDevelopment(isNoneEnv()).bootAwait();
}
Also used : TomcatBoot(org.dbflute.tomcat.TomcatBoot) Host(org.apache.catalina.Host) FessWebResourceRoot(org.codelibs.fess.tomcat.webresources.FessWebResourceRoot) StringUtil(org.codelibs.core.lang.StringUtil) SuppressErrorReportValve(org.codelibs.fess.tomcat.valve.SuppressErrorReportValve) Context(org.apache.catalina.Context) StandardHost(org.apache.catalina.core.StandardHost) TomcatBoot(org.dbflute.tomcat.TomcatBoot) File(java.io.File) StandardHost(org.apache.catalina.core.StandardHost) Host(org.apache.catalina.Host) StandardHost(org.apache.catalina.core.StandardHost) File(java.io.File)

Aggregations

File (java.io.File)1 Context (org.apache.catalina.Context)1 Host (org.apache.catalina.Host)1 StandardHost (org.apache.catalina.core.StandardHost)1 StringUtil (org.codelibs.core.lang.StringUtil)1 SuppressErrorReportValve (org.codelibs.fess.tomcat.valve.SuppressErrorReportValve)1 FessWebResourceRoot (org.codelibs.fess.tomcat.webresources.FessWebResourceRoot)1 TomcatBoot (org.dbflute.tomcat.TomcatBoot)1