界外篇:关于eclipse中springboot项目报错:Invalid character found in the request target解决方案

今天小编在用eclipse处理项目时,需要在接口测试文档输入json,但是报错了:

Invalid character found in the request target The valid characters are defined in RFC 7230 and RFC 3986 

另外提一下:用idea时没报错

解决方案:

在springboot的启动类中 添加:

@Bean
	public ConfigurableServletWebServerFactory webServerFactory() {
	    TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
	    factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
	        public void customize(Connector connector) {
	            connector.setProperty("relaxedQueryChars", "|{}[]");
	        }
	    });
	    return factory;
	}              

界外篇:关于eclipse中springboot项目报错:Invalid character found in the request target解决方案_第1张图片

你可能感兴趣的:(springboot)