add tomcat_config.properties
This commit is contained in:
parent
8045d6abf1
commit
ea112ae4be
7 changed files with 34 additions and 22 deletions
2
pom.xml
2
pom.xml
|
@ -556,6 +556,8 @@
|
|||
<groupId>org.dbflute.tomcat</groupId>
|
||||
<artifactId>tomcat-boot</artifactId>
|
||||
<version>${tomcat.boot.version}</version>
|
||||
<!-- Disable scope at development on IDEA -->
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- test -->
|
||||
|
|
|
@ -80,4 +80,5 @@ FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.name=$APP_NAME"
|
|||
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.path=$FESS_HOME/logs"
|
||||
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.level=info"
|
||||
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dlasta.env=production"
|
||||
FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dtomcat.config.path=tomcat_config.properties"
|
||||
|
||||
|
|
9
src/main/assemblies/files/tomcat_config.properties
Normal file
9
src/main/assemblies/files/tomcat_config.properties
Normal file
|
@ -0,0 +1,9 @@
|
|||
# ========================================================================================
|
||||
# Web
|
||||
# =====
|
||||
# ----------------------------------------------------------
|
||||
# Tomcat
|
||||
# ------
|
||||
tomcat.URIEncoding = UTF-8
|
||||
tomcat.useBodyEncodingForURI = true
|
||||
|
|
@ -51,6 +51,7 @@
|
|||
<directory>${project.basedir}/src/main/assemblies/files</directory>
|
||||
<includes>
|
||||
<include>logging.properties</include>
|
||||
<include>tomcat_config.properties</include>
|
||||
</includes>
|
||||
<outputDirectory>fess-${project.version}/lib/classes</outputDirectory>
|
||||
</fileSet>
|
||||
|
|
|
@ -6,8 +6,6 @@ import org.dbflute.tomcat.TomcatBoot;
|
|||
|
||||
public class FessBoot extends TomcatBoot {
|
||||
|
||||
private static final String FESS_ENV_PROPERTIES = "fess_env.properties";
|
||||
|
||||
private static final String LOGGING_PROPERTIES = "logging.properties";
|
||||
|
||||
private static final String FESS_CONTEXT_PATH = "fess.context.path";
|
||||
|
@ -22,6 +20,8 @@ public class FessBoot extends TomcatBoot {
|
|||
|
||||
private static final String JAVA_IO_TMPDIR = "java.io.tmpdir";
|
||||
|
||||
private static final String TOMCAT_CONFIG_PATH = "tomcat.config.path";
|
||||
|
||||
public FessBoot(final int port, final String contextPath) {
|
||||
super(port, contextPath);
|
||||
}
|
||||
|
@ -60,16 +60,19 @@ public class FessBoot extends TomcatBoot {
|
|||
System.setProperty(JAVA_IO_TMPDIR, value);
|
||||
}
|
||||
|
||||
new FessBoot(getPort(), getContextPath()) //
|
||||
.useTldDetect() // for JSP
|
||||
.configure(FESS_ENV_PROPERTIES) // e.g. URIEncoding
|
||||
.logging(LOGGING_PROPERTIES, op -> {
|
||||
op.ignoreNoFile();
|
||||
final String fessHomeDir = System.getProperty("fess.home");
|
||||
if (fessHomeDir != null) {
|
||||
op.replace("fess.home", fessHomeDir);
|
||||
}
|
||||
}) // uses jdk14logger
|
||||
final String tomcatConfigPath = getTomcatConfigPath();
|
||||
TomcatBoot tomcatBoot = new FessBoot(getPort(), getContextPath()) //
|
||||
.useTldDetect(); // for JSP
|
||||
if (tomcatConfigPath != null) {
|
||||
tomcatBoot.configure(tomcatConfigPath); // e.g. URIEncoding
|
||||
}
|
||||
tomcatBoot.logging(LOGGING_PROPERTIES, op -> {
|
||||
op.ignoreNoFile();
|
||||
final String fessHomeDir = System.getProperty("fess.home");
|
||||
if (fessHomeDir != null) {
|
||||
op.replace("fess.home", fessHomeDir);
|
||||
}
|
||||
}) // uses jdk14logger
|
||||
.asDevelopment(isNoneEnv()).bootAwait();
|
||||
}
|
||||
|
||||
|
@ -92,4 +95,8 @@ public class FessBoot extends TomcatBoot {
|
|||
}
|
||||
return "/fess";
|
||||
}
|
||||
|
||||
protected static String getTomcatConfigPath() {
|
||||
return System.getProperty(TOMCAT_CONFIG_PATH);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,8 +45,4 @@ mail.return.path = root@localhost
|
|||
# ========================================================================================
|
||||
# Web
|
||||
# =====
|
||||
# ----------------------------------------------------------
|
||||
# Tomcat
|
||||
# ------
|
||||
tomcat.URIEncoding = UTF-8
|
||||
tomcat.useBodyEncodingForURI = true
|
||||
|
||||
|
|
|
@ -44,8 +44,4 @@ mail.return.path = root@localhost
|
|||
# ========================================================================================
|
||||
# Web
|
||||
# =====
|
||||
# ----------------------------------------------------------
|
||||
# Tomcat
|
||||
# ------
|
||||
tomcat.URIEncoding = UTF-8
|
||||
tomcat.useBodyEncodingForURI = true
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue