Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihoneymon/9a5c908ae8cc1ee1f21434ddcebc277a to your computer and use it in GitHub Desktop.
Save ihoneymon/9a5c908ae8cc1ee1f21434ddcebc277a to your computer and use it in GitHub Desktop.
/**
* @see <a href="https://www.baeldung.com/spring-xml-vs-java-config">web.xml vs Initializer with Spring</a>
* @see <a href="https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-customizing-embedded-containers"></a>
*/
@Configuration
public class CustomTomcatServletWebServerFactoryCustomizer
implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.addContextCustomizers(new TomcatClusterContextCustomizer());
}
public class TomcatClusterContextCustomizer implements TomcatContextCustomizer {
@Override
public void customize(final Context context) {
context.setDistributable(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment