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

我的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. RabbitMQ生产者消费者模型构建(三)

    ConnectionFactory:获取连接(地址,端口号,用户名,密码,虚拟主机等) Connection:一个连接 Channel:数据通信信道,可发送.接收消息 Queue:具体的消息存储队列 ...

  2. (转)jupyter常用快捷键

    转:http://www.mamicode.com/info-detail-2395285.html Jupyter Notebook 有两种键盘输入模式.即命令模式和编辑模式,这与 vim有些类似. ...

  3. (转)用Flink取代Spark Streaming!知乎实时数仓架构演进

    转:https://mp.weixin.qq.com/s/e8lsGyl8oVtfg6HhXyIe4A AI 前线导读:“数据智能” (Data Intelligence) 有一个必须且基础的环节,就 ...

  4. 制作自己的win7系统

    每次安装完纯净版的系统,然后是漫长的打补丁,装驱动,装软件.不妨制作一个自己的系统光盘(也就是GHOST系统),再要重装系统时,直接用这个系统光盘,一键安装,方便省时. 制作GHOST系统,就是将本地 ...

  5. UI自动化之cookies登录

    现在有很多网站有验证码,跳过验证码实现登录可以使用cookies登录 目录 1.webdriver的添加cookies的方法 2.举个栗子 1.webdriver的添加cookies的方法 webdr ...

  6. Jmeter接口测试报告模板优化(续)

    在之前的基础上又优化了一下: 1.增加了对接口响应时间段的统计,如小于0.5s的请求有多少,0.5-1s的有多少,大于1s的有多少.可以自行修改.且不同范围内的时间字体颜色不一样,便于区分. < ...

  7. curl 和 wget 命令

    1. curl curl 支持 HTTP.HTTPS.FTP 等协议,还支持 POST.cookies.认证.从指定偏移处下载部分文件.User-Agent.限速.文件大小.进度条等特征. 1.1 选 ...

  8. jmeter:清除本地指定目录下的所有类型文件

    1,创建一个sampler 2,要在本地有一个目录的文件 3,直接上代码 String path = "C:\\临时文件\\test111" ;         File file ...

  9. Dubbo的详解

    1.Dubbo是什么? Dubbo是一个分布式服务框架,简言之:dubbo就是个服务框架,如果没有分布式的需求,其实是不需要用的,只有在分布式的时候,才有dubbo这样的分布式服务框架的需求,并且本质 ...

  10. mysql 主从复制(mysql双机热备的实现)

    转:http://blog.csdn.net/qq394829044/article/details/53203645 Mysql数据库没有增量备份的机制,当数据量太大的时候备份是一个很大的问题.还好 ...