Springboot请求中包含特殊字符处理

在springboot的启动类中添加

    @Bean
    public ConfigurableServletWebServerFactory webServerFactory() {
        TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
        factory.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "|{}[]\\"));
        return factory;
    }
```![在这里插入图片描述](https://img-blog.csdnimg.cn/20210322161349517.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzMyNjYyNQ==,size_16,color_FFFFFF,t_70)



你可能感兴趣的:(java)