[英]How can I receive a large string in Java Servlet?
I am building a JSP application.我正在构建一个 JSP 应用程序。 I am trying to send an screenshot image from the page to the servlet by using base64 encoding.我正在尝试使用 base64 编码将屏幕截图图像从页面发送到 servlet。 It makes the returning string super long with 100k characters length.它使返回的字符串超长,长度为 100k 个字符。 So when I post this to the servlet and with getParameter, I am getting null there.因此,当我将其发布到 servlet 并使用 getParameter 时,我在那里得到了 null。
Is there a way to get them by chunks are am I missing something?有没有办法让他们分块我是不是错过了什么?
I found this maybe useful for you.我发现这可能对你有用。
Passing a huge String as post parameter to a servlet 将一个巨大的字符串作为 post 参数传递给 servlet
Namit Rana:纳米特·拉纳:
We used GZip compression/decompression to lower the size of the string.我们使用 GZip 压缩/解压缩来减小字符串的大小。 And it worked effectively.它有效地工作。
So, the .net service compressed the huge string, sent it to our Servlet.因此,.net 服务压缩了巨大的字符串,将其发送到我们的 Servlet。 We then decompress it at our server.然后我们在我们的服务器上解压它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.