Created
May 11, 2017 22:17
-
-
Save khoubyari/72f142f17d484b707b1f7ba4938d6f7f to your computer and use it in GitHub Desktop.
How to configure the embedded Tomcat container in Spring Boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in Application.java | |
@Bean | |
public EmbeddedServletContainerFactory servletContainer() { | |
TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory(); | |
tomcat.setProtocol("org.apache.coyote.http11.Http11Nio2Protocol"); | |
tomcat.addContextCustomizers((context) -> { | |
StandardRoot standardRoot = new StandardRoot(context); | |
standardRoot.setCacheMaxSize(64 * 1024); | |
}); | |
return tomcat; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment