spring url包含 %2F tomcat中400错误

星期日, 2013-03-24 | Author: Lee | JAVA-and-J2EE | 7,669 views

在用spring mvc 开发的一个系统中,参数中包含了/的特殊字符,经过转码生成的是%2F,因为是rest的风格模式,但是在tomcat7.0.24中竟然无法发起请求到对应的severlet去处理,
经过一番的google后,发现是由于安全问题,tomcat禁止了此的访问;
参见:org.apache.tomcat.util.buf. UDecoder.ALLOW_ENCODED_SLASH 的选项打开即可(不推荐此种做法,用另外的方式转换解决)
If this is true ‘%2F’ and ‘%5C’ will be permitted as path delimiters.

If not specified, the default value of false will be used.
可以参考官方说明:http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html

Tags: , ,

文章作者: Lee

本文地址: https://www.pomelolee.com/1181.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta