当前位置: 代码迷 >> 综合 >> Setting 'relaxedQueryChars' for embedded Tomcat
  详细解决方案

Setting 'relaxedQueryChars' for embedded Tomcat

热度:81   发布时间:2023-11-03 12:45:41.0

Setting ‘relaxedQueryChars’ for embedded Tomcat

How can I set relaxedQueryChars for Spring Boot embedded Tomcat?

The connector attribute described here, but Spring Boot documentation has no such parameter listed.

How to set Tomcat’s Connector attributes in general?
Tomcat 2.x.x 以上版本

@Component
public class MyTomcatWebServerCustomizer
implements WebServerFactoryCustomizer {

@Override
public void customize(TomcatServletWebServerFactory factory) {factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {@Overridepublic void customize(Connector connector) {connector.setAttribute("relaxedQueryChars", "yourvaluehere");}});
}

}

  相关解决方案