您的当前位置:首页正文

SpringBoot get请求接收特殊字符{}

2024-11-30 来源:个人技术集锦

在主启动类添加如下方法

 @Bean
 public TomcatServletWebServerFactory tomcatServletWebServerFactory() {
     // 修改内置的 tomcat 容器配置
     TomcatServletWebServerFactory tomcatServlet = new TomcatServletWebServerFactory();
     tomcatServlet.addConnectorCustomizers(
             (TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "{}")
     );
     return tomcatServlet;
 }
显示全文