终极解决方案:(导出可能出现)

我的tomcat版本是8.5.32,导出时遇到以下报错。

报错日志

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

从错误日志中看到对请求URL中对字符做了限制。

解决方法

1.在tomcat安装路径中conf/catalina.properties中最后添加2行:

tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

网上还有一些掩耳盗铃的做法,就是降低tomcat的版本。Tomcat在 8.5版本后,在http解析时做了严格限制。

requestTargetAllow 只能配置|、{、} 这三个字符,对于其他的(例如" < > [ \ ] ^ ` { | } .),依旧报错,如果使用了|{}之外的其他字符,那就还需要如下配置。

2.在conf/server.xml中的<Connector>节点中,添加2个属性(可以接收任意特殊字符的组合,自行配置):

relaxedPathChars="|{}[],\"
relaxedQueryChars="|{}[],\"

终极解决方案: Invalid character found in the request target.的更多相关文章

  1. Tomcat 8 Invalid character found in the request target. The valid characters are defined in RFC 3986

    终极解决方案: Invalid character found in the request target. The valid characters are defined in RFC 3986 ...

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

    解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RF ...

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

      1.情景展示 tomcat 日志时不时会报出如下异常信息,到底是怎么回事? java.lang.IllegalArgumentException: Invalid character found ...

  4. 已解决:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 问题

    请求: http://127.0.0.1:8080/driverApp/findLikeAddress?json={"shopname":"广东省"," ...

  5. 【Tomcat】Invalid character found in the request target

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

  6. Tomcat v7.0 java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

    十二月 , :: 下午 org.apache.coyote.http11.AbstractHttp11Processor process 信息: Error parsing HTTP request ...

  7. Invalid character found in the request target.

    背景:springboot项目内置tomcat9.0 调用的接口中有{}就会报错 解决办法: 新的tomcat新版本增加了一个新特性,就是严格按照 RFC 3986规范进行访问解析,而 RFC 398 ...

  8. java.lang.IllegalArgumentException: Invalid character found in the request target.

    java.lang.IllegalArgumentException: Invalid character found in the request target. http参数存在特殊字符: 特殊字 ...

  9. Tomcat : Invalid character found in the request target

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

随机推荐

  1. 20180805-Java DataInputStream类

    DataInputStream dis = DataInputStream(InputStream in); 下面的例子演示了DataInputStream和DataOutputStream的使用,该 ...

  2. python-zx笔记9-单元测试

    unittest核心要素 1.TestCase 一个TestCase的实例就是一个测试用例.什么是测试用例呢?就是一个完整的测试流程,包括测试前准备环境的搭建(setUp),执行测试代码(run),以 ...

  3. java并发编程如何预防死锁

    在java并发编程领域已经有技术大咖总结出了发生死锁的条件,只有四个条件都发生时才会出现死锁: 1.互斥,共享资源X和Y只能被一个线程占用 2.占有且等待,线程T1已经取得共享资源X,在等待共享资源Y ...

  4. HTML中<input>和<textarea>的区别

    在HTML中有两种方式表达文本框 一个是<input>元素的单行文本框 一种是<textarea>的多行文本框. <input>元素: 1.一定要指定type的值为 ...

  5. 阿里云code下载代码和更新代码

    1- 本地新建一个文件夹,进入文件夹下面右击打开git 2- Git init初始化一个.git文件夹 3- Git clone git@code.aliyun.com:username/space- ...

  6. 影视感悟专题---1、B站-魔兽世界代理及其它乱七八糟

    影视感悟专题---1.B站-魔兽世界代理及其它乱七八糟 一.总结 一句话总结: 看过的东西都可以学下,这样既可以学习那些东西,都是对自己生活学习有帮助的,还可以弥补自己每天学的东西的不够 1.< ...

  7. 牛客提高D6t1 积木大赛

    分析 每次修改用二位差分记录一下 之后对于三维分别统计即可 代码 #include<iostream> #include<cstdio> #include<cstring ...

  8. rssi pdf 单双峰正态发布 与 定位

  9. 云计算openstack共享组件——Memcache 缓存系统

    一.缓存系统 静态web页面: 1.工作流程: 在静态Web程序中,客户端使用Web浏览器(IE.FireFox等)经过网络(Network)连接到服务器上,使用HTTP协议发起一个请求(Reques ...

  10. LATERAL VIEW 语法

    LATERAL VIEW 使用语法 原文链接: https://www.deeplearn.me/2892.html select a.id, b.son_order_path from f_jz_c ...