You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
servlet context parameters will be replaced by ServletWebServerFactoryCustomizer when providing a custom TomcatServletWebServerFactory
I used @Bean to customize TomcatServletWebServerFactory,and set the servlet context parameters, but the parameters replaced by ServletWebServerFactoryCustomizer get from org.springframework.boot.autoconfigure.web.ServerProperties, Is this a bug ?
Here is my @Bean code
@Bean
public TomcatServletWebServerFactory tomcatServletWebServerFactory() {
TomcatServletWebServerFactory tomcatServletWebServerFactory =
new TomcatServletWebServerFactory();
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("param1", "value1");
hashMap.put("param2", "value2");
tomcatServletWebServerFactory.setInitParameters(hashMap);
return tomcatServletWebServerFactory;
}
But the following code will replace my parameter settings