This content has been marked as final.
Show 2 replies
-
1. Re: POST request truncated in JBoss but not in WebLogic?
raquelaraujo27 Aug 20, 2004 12:23 PM (in response to thebadpete)Hello, I am having a similar problem and I am wondering if you found the answer to your problem.
Thanks... -
2. Re: POST request truncated in JBoss but not in WebLogic?
thebadpete Aug 28, 2004 12:15 PM (in response to thebadpete)Hi there,
Yes, I figured it out. It turns out that you will need to read the ServletInputStream byte-by-byte, something like the following:
InputStreamReader insr = new InputStreamReader(req.getInputStream());
BufferedReader in = new BufferedReader(insr);
// cntLen is the length indicated in HTTP header
char[] cntBody = new char[cntLen];
int read = 0, cntByte = 0;
while((cntByte = in.read()) != -1) {
cntBody[read] = (char)cntByte;
read++;
}
String strResult = new String(cntBody);
It solved my problem. Not elegant for sure, but I am glad I get no truncation issue anymore. Hope this helps!