简体   繁体   English

请求后的Java servlet getParameter被截断

[英]Java servlet getParameter in post-request truncated

we have a servlet and sending a post-message to it. 我们有一个servlet,并向它发送后消息。 In the networktraffic, we could see that the parameter is complete. 在网络流量中,我们可以看到该参数是完整的。 When calling the request.getParameter(paramname) function in the java servlet we get the value truncated after a special number of characters, not a specific character. 当在Java Servlet中调用request.getParameter(paramname)函数时,我们得到的值在特殊字符数(而不是特定字符)后被截断。 So when adding some characters to "somewordthatislong" the position where the param is truncated inside the date moves to the left. 因此,在“ islong islong”中添加一些字符时,日期内参数被截断的位置会移到左侧。

Does anyone have an idea why this happens? 有谁知道为什么会这样?

Parameter post message from network 来自网络的参数发布消息

q=somewordthatislong+AND+document_meta_documentarchive_publicationsdatum_manipulated%3A%5B2014%2F01%2F01+TO+2015%2F12%2F31%5D

Calling the request.getParameter(paramname) function 调用request.getParameter(paramname)函数

q=somewordthatislong
    +AND+document_meta_documentarchive_publicationsdatum_manipulated%3A%5B2014%2F01%2F01+TO+2

Url-decoded value of the param is 参数的网址解码值为

q=somewordthatislong AND document_meta_documentarchive_publicationsdatum_manipulated:[2014/01/01 TO 2015/12/31]

Further analysis has shown that there is a class extending HTTPRequest and getParameter, which cuts q after ~100 chars. 进一步的分析表明,存在一个扩展HTTPRequest和getParameter的类,该类在约100个字符后减少q。 Sorry Guys was not obvious for me to see because of dependency injection. 对不起,由于依赖注入,对我来说我并不明显。

Thought it was a standard HTTPRequest. 以为这是一个标准的HTTPRequest。 Thanks for your help! 谢谢你的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM