【发布时间】:2014-05-29 20:46:32
【问题描述】:
我有一个 java servlet 应用程序,我们正在将它从 WebSphere 移植到 TC Server 并从 java 2 升级到 java 7。
在测试中,我们发现以 % 符号结尾的参数(包括密码)正在丢失。
这是一个示例片段
帐号不在parameterMap中。
在研究中我发现了。
如果我首先询问请求对象,getQueryString() 有我的参数,但是 ... getParameterMap() 将其过滤掉。
因此,它适用于旧的 WebSphere/Java 2 版本,但不适用于 TC Server/Java 7 版本。
我尝试过的事情。
request.setCharacterEncoding("utf-8") at the top of the doGet - no affect.
<Connector ... URIEncoding="UTF-8" ... </Connector> in my server.xml - no affect.
【问题讨论】:
-
在截断结尾
%后工作正常。它引起了问题。 -
像这样放置一个悬空百分比可能是一个非法的 URL,因为它是一个不完整的字节。行为将是未定义的。
-
@DavidEhrmann 请将您的评论转化为答案,以便我将正确答案奖励给您。
标签: java http tomcat servlets tcserver