|
|
@ -11,36 +11,36 @@ public class TomcatApplication { |
|
|
|
|
|
|
|
|
|
|
|
public static void configure(TomcatEmbeddedServletContainerFactory tomcatFactory) { |
|
|
|
public static void configure(TomcatEmbeddedServletContainerFactory tomcatFactory) { |
|
|
|
|
|
|
|
|
|
|
|
tomcatFactory.addContextCustomizers((TomcatContextCustomizer) context -> { |
|
|
|
tomcatFactory.addContextCustomizers((TomcatContextCustomizer) context -> { |
|
|
|
|
|
|
|
|
|
|
|
StandardJarScanFilter standardJarScanFilter = new StandardJarScanFilter(); |
|
|
|
StandardJarScanFilter standardJarScanFilter = new StandardJarScanFilter(); |
|
|
|
standardJarScanFilter.setTldScan("dwr-*.jar,jstl-*.jar,spring-security-taglibs-*.jar,spring-web-*.jar,spring-webmvc-*.jar,string-*.jar,taglibs-standard-impl-*.jar,tomcat-annotations-api-*.jar,tomcat-embed-jasper-*.jar"); |
|
|
|
standardJarScanFilter.setTldScan("dwr-*.jar,jstl-*.jar,spring-security-taglibs-*.jar,spring-web-*.jar,spring-webmvc-*.jar,string-*.jar,taglibs-standard-impl-*.jar,tomcat-annotations-api-*.jar,tomcat-embed-jasper-*.jar"); |
|
|
|
standardJarScanFilter.setTldSkip("*"); |
|
|
|
standardJarScanFilter.setTldSkip("*"); |
|
|
|
context.getJarScanner().setJarScanFilter(standardJarScanFilter); |
|
|
|
context.getJarScanner().setJarScanFilter(standardJarScanFilter); |
|
|
|
|
|
|
|
|
|
|
|
boolean development = (System.getProperty("airsonic.development") != null); |
|
|
|
boolean development = (System.getProperty("airsonic.development") != null); |
|
|
|
|
|
|
|
|
|
|
|
// Increase the size and time before eviction of the Tomcat
|
|
|
|
// Increase the size and time before eviction of the Tomcat
|
|
|
|
// cache so that resources aren't uncompressed too often.
|
|
|
|
// cache so that resources aren't uncompressed too often.
|
|
|
|
// See https://github.com/jhipster/generator-jhipster/issues/3995
|
|
|
|
// See https://github.com/jhipster/generator-jhipster/issues/3995
|
|
|
|
|
|
|
|
|
|
|
|
StandardRoot resources = new StandardRoot(); |
|
|
|
StandardRoot resources = new StandardRoot(); |
|
|
|
if (development) { |
|
|
|
if (development) { |
|
|
|
resources.setCachingAllowed(false); |
|
|
|
resources.setCachingAllowed(false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
resources.setCacheMaxSize(100000); |
|
|
|
resources.setCacheMaxSize(100000); |
|
|
|
resources.setCacheObjectMaxSize(4000); |
|
|
|
resources.setCacheObjectMaxSize(4000); |
|
|
|
resources.setCacheTtl(24 * 3600 * 1000); // 1 day, in milliseconds
|
|
|
|
resources.setCacheTtl(24 * 3600 * 1000); // 1 day, in milliseconds
|
|
|
|
} |
|
|
|
} |
|
|
|
context.setResources(resources); |
|
|
|
context.setResources(resources); |
|
|
|
|
|
|
|
|
|
|
|
// Put Jasper in production mode so that JSP aren't recompiled
|
|
|
|
// Put Jasper in production mode so that JSP aren't recompiled
|
|
|
|
// on each request.
|
|
|
|
// on each request.
|
|
|
|
// See http://stackoverflow.com/questions/29653326/spring-boot-application-slow-because-of-jsp-compilation
|
|
|
|
// See http://stackoverflow.com/questions/29653326/spring-boot-application-slow-because-of-jsp-compilation
|
|
|
|
Container jsp = context.findChild("jsp"); |
|
|
|
Container jsp = context.findChild("jsp"); |
|
|
|
if (jsp instanceof Wrapper) { |
|
|
|
if (jsp instanceof Wrapper) { |
|
|
|
((Wrapper) jsp).addInitParameter("development", Boolean.toString(development)); |
|
|
|
((Wrapper) jsp).addInitParameter("development", Boolean.toString(development)); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|